

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="沧海横流，尽显英雄本色；激浊扬清，正是猛士当时">
  <meta name="author" content="closer">
  <meta name="keywords" content="">
  
  <title>按键精灵语法 - closer的自留地</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10.6.0/styles/androidstudio.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
  



<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"blog.zsaa.top","root":"/","version":"1.8.10","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"always","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"baidu":"608f2baddd361128381ad2bf9377bf89","google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":"YzLqNtMw1YEwwACli1FUsIUM-gzGzoHsz","app_key":"HLUt5izfTvTcbEbOrA59W92a","server_url":"https://yzlqntmw.lc-cn-n1-shared.com"}}};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>Hello</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/links/">
                <i class="iconfont icon-link-fill"></i>
                友链
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.jpg') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="按键精灵语法">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2020-04-09 20:58" pubdate>
        2020年4月9日 晚上
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      8.6k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      132
       分钟
    </span>
  

  
  
    
      <!-- LeanCloud 统计文章PV -->
      <span id="leancloud-page-views-container" class="post-meta" style="display: none">
        <i class="iconfont icon-eye" aria-hidden="true"></i>
        <span id="leancloud-page-views"></span> 次
      </span>
    
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">按键精灵语法</h1>
            
              <p class="note note-info">
                
                  本文最后更新于：2022年10月6日 晚上
                
              </p>
            
            <div class="markdown-body">
              <p>windows或者Android(需要root权限)下按键精灵有时候写一些简单的脚本还是挺好用的。没有最好的语言，只有最适合的工具。在此记录下常用的基本语法。</p>
<h2 id="一：句柄及后台运行"><a href="#一：句柄及后台运行" class="headerlink" title="一：句柄及后台运行"></a>一：句柄及后台运行</h2><p>句柄可以获取后台窗口的类名或者标题，以达到获取坐标或后台运行脚本的目的。<br><strong>后台只支持部分窗口，以实际测试为准。</strong></p>
<p>句柄的类名或者标题，可以用按键精灵自带的抓抓工具抓取。</p>
<figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs vb">//声明窗口句柄变量，窗口大小变量<br><span class="hljs-keyword">Dim</span> Hwnd, sRect<br>//声明数组<br><span class="hljs-keyword">Dim</span> Array<br><br>//Plugin.Window.Find()--命令功能-查找窗口类名或者标题<br>//下面这句是查找窗口类名(<span class="hljs-string">&quot;Notepad&quot;</span>)或者标题(<span class="hljs-number">0</span>),返回找到的句柄Hwnd<br>Hwnd = Plugin.Window.Find(<span class="hljs-string">&quot;Notepad&quot;</span>,<span class="hljs-string">&quot;0&quot;</span>)<br><br>//调试输出句柄-功能-在调试窗口打印文字<br>TracePrint Hwnd<br><br>//该函数返回窗口大小<br>sRect = Plugin.Window.GetWindowRect(Hwnd)<br><br>//窗口大小转为数组，可以获得窗口左上角的坐标<br>//语法 Split(expression[, delimiter[, count[, start]]])<br>//字符串为sRect，分割方式‘|’<br>Array = Split(sRect, <span class="hljs-string">&quot;|&quot;</span>)<br><br>//左上角坐标的X,Y轴坐标<br>TracePrint Array(<span class="hljs-number">0</span>)<br>TracePrint Array(<span class="hljs-number">1</span>)<br><br>//下拉型自定义变量<br>//格式: UserVar 变量名=DropList&#123;选项<span class="hljs-number">0</span>:值<span class="hljs-number">0</span>|选项<span class="hljs-number">1</span>:值<span class="hljs-number">1</span>|选项<span class="hljs-number">2</span>:值<span class="hljs-number">2</span>&#125;=默认显示的选项编号 &#123;注释&#125;<br>//解释:这个命令预先设定多个变量值，用户可在基面通过下拉方式进行选择<br>//示例<br>UserVar Var1=DropList&#123;<span class="hljs-string">&quot;低于10%时补血&quot;</span>:<span class="hljs-number">0.1</span>|<span class="hljs-string">&quot;低于20%时补血&quot;</span>:<span class="hljs-number">0.2</span>|<span class="hljs-string">&quot;低于30%时补血&quot;</span>:<span class="hljs-number">0.3</span>&#125;=<span class="hljs-number">2</span> <span class="hljs-string">&quot;自动补血设置&quot;</span><br><br>//左键点击<span class="hljs-number">5</span>次<br>LeftClick <span class="hljs-number">5</span><br><br>//<span class="hljs-keyword">Function</span>函数<br><span class="hljs-keyword">Function</span> increase(x,y)<br>    <span class="hljs-keyword">If</span> v = <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span><br>        //键盘输入enter<br>        KeyPress <span class="hljs-string">&quot;Enter&quot;</span>, <span class="hljs-number">1</span><br>    <span class="hljs-keyword">Else</span><br>        //鼠标移动到指定坐标<br>        MoveTo Array(<span class="hljs-number">0</span>)+<span class="hljs-number">406</span>, Array(<span class="hljs-number">1</span>)+<span class="hljs-number">342</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//调用函数或子程序<br><span class="hljs-keyword">call</span> Function_name<br><br>//LeftClick 左键单击<br>//命令功能 向后台窗口句柄送一个鼠标左键单击 (注意：只支持部分窗口，以实际测试为准。)<br><span class="hljs-keyword">Call</span> Plugin.Bkgnd.LeftClick(Hwnd, <span class="hljs-number">550</span>, <span class="hljs-number">262</span>)<br>//后台输入按键enter，<span class="hljs-number">13</span>是按键码，可以在按键精灵中与实际按键互相转换<br><span class="hljs-keyword">Call</span> Plugin.Bkgnd.KeyPress(Hwnd, <span class="hljs-number">13</span>)<br><br>//添加延迟，单位毫秒ms<br>Delay <span class="hljs-number">500</span><br><br>//<span class="hljs-keyword">For</span>循环<br><span class="hljs-keyword">For</span> i=<span class="hljs-number">0</span> <span class="hljs-keyword">To</span> <span class="hljs-number">5</span><br>    <span class="hljs-keyword">For</span> j=<span class="hljs-number">0</span> <span class="hljs-keyword">TO</span> <span class="hljs-number">7</span><br>        <span class="hljs-keyword">Call</span> increase(x, y)<br>        x = x + <span class="hljs-number">30</span><br>    <span class="hljs-keyword">Next</span><br>    x = <span class="hljs-number">488</span><br>    y = y + <span class="hljs-number">30</span><br><span class="hljs-keyword">Next</span><br></code></pre></div></td></tr></table></figure>

<h2 id="二：带GUI的脚本"><a href="#二：带GUI的脚本" class="headerlink" title="二：带GUI的脚本"></a>二：带GUI的脚本</h2><p>先要在界面画出窗体（form）及各种输入框，下拉框，标签，按钮等。。。</p>
<p>下面是QQ后台刷屏脚本，先画4个标签，4个输入框，1个下拉框，1个按钮</p>
<figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs VB">//事件：form是窗体，load是加载，定义下拉框属性<br><span class="hljs-keyword">Event</span> Form1.Load<br>    //窗体<span class="hljs-number">1</span>中的ComboBox1下拉框<span class="hljs-number">1</span>有是和否<span class="hljs-number">2</span>个选择<br>    Form1.ComboBox1.List = <span class="hljs-string">&quot;是|否&quot;</span><br>    //窗体下拉框初始选项<br>    Form1.ComboBox1.ListIndex = <span class="hljs-number">0</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Event</span><br><br>//定义窗体<span class="hljs-number">1</span>的按钮<span class="hljs-number">1</span>的点击触发事件<br><span class="hljs-keyword">Event</span> Form1.Button1.Click<br>    //窗体<span class="hljs-number">1</span>的输入框<span class="hljs-number">1</span>的文本赋予变量title<br>    title = Form1.InputBox1.<span class="hljs-keyword">Text</span><br>    //找到QQ窗口句柄<br>    Hwnd=Plugin.Window.Find(<span class="hljs-string">&quot;TXGuiFoundation&quot;</span>,title)<br>    t = <span class="hljs-number">1</span><br>    //窗体<span class="hljs-number">1</span>的输入框<span class="hljs-number">4</span>的文本转化为int赋予变量times<br>    times = Int(Form1.InputBox4.<span class="hljs-keyword">Text</span>)<br>    //数组真假赋予subfix<br>    subfix=Array(<span class="hljs-literal">true</span>,<span class="hljs-literal">false</span>)<br>    <span class="hljs-keyword">text</span> = Form1.InputBox2.<span class="hljs-keyword">Text</span><br>    rate = Form1.InputBox3.<span class="hljs-keyword">Text</span><br>    //<span class="hljs-keyword">while</span>循环<br>    <span class="hljs-keyword">While</span> t &lt;= times <span class="hljs-built_in">OR</span> times = <span class="hljs-number">0</span><br>        <span class="hljs-keyword">If</span> subfix(Form1.ComboBox1.ListIndex) <span class="hljs-keyword">Then</span><br>            //后台发送文本加自增计数变量<br>            <span class="hljs-keyword">Call</span> Plugin.Bkgnd.SendString(Hwnd,<span class="hljs-keyword">text</span> &amp; t)<br>        <span class="hljs-keyword">Else</span><br>            //后台发送文本<span class="hljs-keyword">text</span><br>            <span class="hljs-keyword">Call</span> Plugin.Bkgnd.SendString(Hwnd,<span class="hljs-keyword">text</span>)<br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        //输入enter<br>        <span class="hljs-keyword">Call</span> Plugin.Bkgnd.KeyPress(Hwnd, <span class="hljs-number">13</span>)<br>        t = t + <span class="hljs-number">1</span><br>        //发送事件间隔为变量rate<br>        Delay rate<br>    Wend<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Event</span><br></code></pre></div></td></tr></table></figure>

<h2 id="三：多线程"><a href="#三：多线程" class="headerlink" title="三：多线程"></a>三：多线程</h2><figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs VB">DimEnv T1<br>DimEnv T2<br><span class="hljs-keyword">Call</span> start_1<br><span class="hljs-keyword">Sub</span> start_1<br>    //线程<span class="hljs-number">1</span><br>    T1 = BeginThread(thread1)<br>    T2 = BeginThread(thread2)<br>    BeginThread <span class="hljs-keyword">Stop</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><span class="hljs-keyword">Sub</span> thread1<br>    name_1 = <span class="hljs-string">&quot;测试1&quot;</span><br>    t_1 = <span class="hljs-number">0</span><br>    rate_1 = <span class="hljs-number">1000</span><br>    times_1 = <span class="hljs-number">100</span><br>    subfix_1=<span class="hljs-literal">true</span><br>    test_1 = <span class="hljs-string">&quot;测试&quot;</span><br>    //<span class="hljs-keyword">while</span>循环<br>    Hwnd_1 = Plugin.Window.Find(<span class="hljs-number">0</span>, name_1)<br>    //当输入t=-<span class="hljs-number">1</span>时则循环发送消息至按终止键为止<br>    <span class="hljs-keyword">While</span> t_1 &lt;= times_1 <span class="hljs-built_in">OR</span> times_1 = <span class="hljs-number">0</span><br>        <span class="hljs-keyword">If</span> subfix_1 <span class="hljs-keyword">Then</span><br>            //后台发送文本加自增计数变量<br>            <span class="hljs-keyword">Call</span> Plugin.Bkgnd.SendString(Hwnd_1,test_1 &amp; t_1)<br>        <span class="hljs-keyword">Else</span><br>            //后台发送文本test_1<br>            <span class="hljs-keyword">Call</span> Plugin.Bkgnd.SendString(Hwnd_1,test_1)<br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        <span class="hljs-keyword">Call</span> Plugin.Bkgnd.KeyPress(Hwnd_1, <span class="hljs-number">13</span>)<br>        t_1 = t_1 + <span class="hljs-number">1</span><br>        //发送事件间隔为变量rate_1<br>        Delay rate_1<br>    Wend<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><span class="hljs-keyword">Sub</span> thread2<br>    name_2 = <span class="hljs-string">&quot;测试2&quot;</span><br>    t_2 = <span class="hljs-number">0</span><br>    rate_2 = <span class="hljs-number">1000</span><br>    times_2 = <span class="hljs-number">100</span><br>    subfix_2=<span class="hljs-literal">true</span><br>    test_2 = <span class="hljs-string">&quot;测试&quot;</span><br>    //<span class="hljs-keyword">while</span>循环<br>    Hwnd_2 = Plugin.Window.Find(<span class="hljs-number">0</span>,name_2)<br>    <span class="hljs-keyword">While</span> t_2 &lt;= times_2 <span class="hljs-built_in">OR</span> times_2 = <span class="hljs-number">0</span><br>        <span class="hljs-keyword">If</span> subfix_2 <span class="hljs-keyword">Then</span><br>            //后台发送文本加自增计数变量<br>            <span class="hljs-keyword">Call</span> Plugin.Bkgnd.SendString(Hwnd_2,test_2 &amp; t_2)<br>        <span class="hljs-keyword">Else</span><br>            //后台发送文本test_2<br>            <span class="hljs-keyword">Call</span> Plugin.Bkgnd.SendString(Hwnd_2,test_2)<br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        <span class="hljs-keyword">Call</span> Plugin.Bkgnd.KeyPress(Hwnd_2, <span class="hljs-number">13</span>)<br>        t_2 = t_2 + <span class="hljs-number">1</span><br>        //发送事件间隔为变量rate_2<br>        Delay rate_2<br>    Wend<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><span class="hljs-keyword">Sub</span> <span class="hljs-keyword">stop</span><br>    s_1 = <span class="hljs-string">&quot;A&quot;</span><br>    s_2 = <span class="hljs-string">&quot;Z&quot;</span><br>    running = <span class="hljs-literal">True</span><br>    <span class="hljs-keyword">While</span> <span class="hljs-literal">True</span><br>        //监听按键<br>        s = Waitkey<br>        <span class="hljs-keyword">If</span> s = Asc(s_1) <span class="hljs-built_in">and</span> running  <span class="hljs-keyword">Then</span><br>            PauseThread T1<br>            running = <span class="hljs-literal">False</span><br>        <span class="hljs-keyword">ElseIf</span> s = Asc(s_1) <span class="hljs-built_in">and</span> <span class="hljs-built_in">not</span> running <span class="hljs-keyword">Then</span><br>            PauseThread T1<br>            running = <span class="hljs-literal">True</span><br>        <span class="hljs-keyword">ElseIf</span> s = Asc(s_2) <span class="hljs-keyword">Then</span><br>            StopThread T2<br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    Wend<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><br></code></pre></div></td></tr></table></figure>

<h2 id="四：带界面的前台的脚本示例"><a href="#四：带界面的前台的脚本示例" class="headerlink" title="四：带界面的前台的脚本示例"></a>四：带界面的前台的脚本示例</h2><figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs VB">//声明窗口句柄变量<br><span class="hljs-keyword">Dim</span> Hwnd, sRect<br><span class="hljs-keyword">Dim</span> Array<br>//下面这句是查找窗口类名(<span class="hljs-string">&quot;Notepad&quot;</span>)或者标题(<span class="hljs-number">0</span>),返回找到的句柄Hwnd<br>Hwnd = Plugin.Window.Find(<span class="hljs-string">&quot;DNF Taiwan&quot;</span>,<span class="hljs-string">&quot;DNF Taiwan&quot;</span>)<br>//调试输出<br>TracePrint Hwnd<br>//返回窗口大小<br>sRect = Plugin.Window.GetWindowRect(Hwnd)<br>//窗口大小转为数组<br>Array = Split(sRect, <span class="hljs-string">&quot;|&quot;</span>)<br>TracePrint Array(<span class="hljs-number">0</span>)<br>TracePrint Array(<span class="hljs-number">1</span>)<br><br>//功能选择<br>UserVar Var0 = DropList&#123;<span class="hljs-string">&quot;自动增幅&quot;</span>:<span class="hljs-string">&quot;1&quot;</span>|<span class="hljs-string">&quot;娃娃机&quot;</span>:<span class="hljs-string">&quot;2&quot;</span>|<span class="hljs-string">&quot;先娃娃机再增幅&quot;</span>:<span class="hljs-string">&quot;3&quot;</span>|<span class="hljs-string">&quot;鼠标左键连点&quot;</span>:<span class="hljs-string">&quot;4&quot;</span>|<span class="hljs-string">&quot;自动锻造&quot;</span>:<span class="hljs-string">&quot;5&quot;</span>&#125;=<span class="hljs-number">3</span> <span class="hljs-string">&quot;功能选择&quot;</span><br><br>//选择窗口，选择力量还是智力<br>UserVar Var1 = DropList&#123;<span class="hljs-string">&quot;增幅力量&quot;</span>:<span class="hljs-string">&quot;1&quot;</span>|<span class="hljs-string">&quot;增幅智力&quot;</span>:<span class="hljs-string">&quot;2&quot;</span>&#125;=<span class="hljs-number">0</span> <span class="hljs-string">&quot;选择增幅力量还是智力&quot;</span><br>//选择窗口，选择<span class="hljs-number">15</span>还是<span class="hljs-number">13</span>增幅券<br>UserVar Var2 = DropList&#123;<span class="hljs-string">&quot;13&quot;</span>:<span class="hljs-number">13</span>|<span class="hljs-string">&quot;15&quot;</span>:<span class="hljs-number">15</span>&#125;=<span class="hljs-number">1</span> <span class="hljs-string">&quot;选择13还是15增幅券&quot;</span><br>//设置鼠标点击延迟<br>UserVar Yanshi=<span class="hljs-number">50</span> <span class="hljs-string">&quot;两次点击的时间间隔（毫秒）&quot;</span><br><br>//强打增幅<span class="hljs-number">1</span>件装备<br><span class="hljs-keyword">Function</span> increase(x,y)<br>    //使用强打书<br>    KeyPress <span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-number">1</span><br>    //延迟<br>    Delay <span class="hljs-number">200</span><br>    //点击力量增幅<br>    <span class="hljs-keyword">If</span> var1 = <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span><br>        MoveTo Array(<span class="hljs-number">0</span>)+<span class="hljs-number">406</span>, Array(<span class="hljs-number">1</span>)+<span class="hljs-number">300</span><br>        LeftClick <span class="hljs-number">1</span><br>        //点击智力增幅<br>    <span class="hljs-keyword">Else</span><br>        MoveTo Array(<span class="hljs-number">0</span>)+<span class="hljs-number">406</span>, Array(<span class="hljs-number">1</span>)+<span class="hljs-number">342</span><br>        LeftClick <span class="hljs-number">1</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    Delay <span class="hljs-number">200</span><br>    //点击使用<br>    MoveTo Array(<span class="hljs-number">0</span>)+<span class="hljs-number">374</span>, Array(<span class="hljs-number">1</span>)+<span class="hljs-number">391</span><br>    LeftClick <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">200</span><br>    //点击第一格装备<br>    MoveTo Array(<span class="hljs-number">0</span>)+x, Array(<span class="hljs-number">1</span>)+y<br>    LeftClick <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">200</span><br>    //确定<br>    KeyPress <span class="hljs-string">&quot;Enter&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">200</span><br>    KeyPress <span class="hljs-string">&quot;Enter&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">200</span><br>    //使用增幅书<br>    KeyPress <span class="hljs-string">&quot;2&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">200</span><br>    //点击第一格装备<br>    MoveTo Array(<span class="hljs-number">0</span>)+x, Array(<span class="hljs-number">1</span>)+y<br>    LeftClick <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">200</span><br>    //确定<br>    KeyPress <span class="hljs-string">&quot;Enter&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">200</span><br>    <span class="hljs-keyword">If</span> var2 = <span class="hljs-number">13</span> <span class="hljs-keyword">Then</span><br>        KeyPress <span class="hljs-string">&quot;Enter&quot;</span>, <span class="hljs-number">1</span><br>        Delay <span class="hljs-number">200</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    //一格装备完成<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//增幅装备栏<br><span class="hljs-keyword">Function</span> zengfu()<br>    //主程序<br>    x = <span class="hljs-number">488</span><br>    y = <span class="hljs-number">288</span><br>    <span class="hljs-keyword">For</span> i=<span class="hljs-number">0</span> <span class="hljs-keyword">To</span> <span class="hljs-number">5</span><br>        <span class="hljs-keyword">For</span> j=<span class="hljs-number">0</span> <span class="hljs-keyword">TO</span> <span class="hljs-number">7</span><br>            <span class="hljs-keyword">Call</span> increase(x, y)<br>            x = x + <span class="hljs-number">30</span><br>        <span class="hljs-keyword">Next</span><br>        x = <span class="hljs-number">488</span><br>        y = y + <span class="hljs-number">30</span><br>    <span class="hljs-keyword">Next</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//抽娃娃机<br><span class="hljs-keyword">Function</span> wawaji()<br>    <span class="hljs-keyword">For</span> temp=<span class="hljs-number">0</span> <span class="hljs-keyword">TO</span> <span class="hljs-number">46</span><br>        //投币<br>        MoveTo Array(<span class="hljs-number">0</span>)+<span class="hljs-number">152</span>, Array(<span class="hljs-number">1</span>)+<span class="hljs-number">402</span><br>        LeftClick <span class="hljs-number">1</span><br>        Delay <span class="hljs-number">200</span><br>        //确认<br>        MoveTo Array(<span class="hljs-number">0</span>)+<span class="hljs-number">358</span>, Array(<span class="hljs-number">1</span>)+<span class="hljs-number">345</span><br>        LeftClick <span class="hljs-number">1</span><br>        Delay <span class="hljs-number">200</span><br>        //停止<br>        MoveTo Array(<span class="hljs-number">0</span>)+<span class="hljs-number">200</span>, Array(<span class="hljs-number">1</span>)+<span class="hljs-number">402</span><br>        LeftClick <span class="hljs-number">1</span><br>        Delay <span class="hljs-number">5500</span><br>        //确定<br>        KeyPress <span class="hljs-string">&quot;Enter&quot;</span>, <span class="hljs-number">1</span><br>        Delay <span class="hljs-number">200</span><br>    <span class="hljs-keyword">Next</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//抽娃娃机和增幅装备栏<br><span class="hljs-keyword">Function</span> wawajiandzengfu()<br>    <span class="hljs-keyword">Call</span> wawaji()<br>    KeyPress <span class="hljs-string">&quot;Esc&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">200</span><br>    KeyPress <span class="hljs-string">&quot;i&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">200</span><br>    <span class="hljs-keyword">Call</span> zengfu()<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//鼠标左击<br><span class="hljs-keyword">Function</span> autoLeftClick()<br>    <span class="hljs-keyword">While</span> <span class="hljs-literal">True</span><br>        //说明：按照一定频率反复点击鼠标左键<br>        //<span class="hljs-number">1</span>秒 = <span class="hljs-number">1000</span>毫秒<br>        LeftClick <span class="hljs-number">1</span><br>        Delay Yanshi<br>    Wend<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><br>//自动锻造<br><span class="hljs-keyword">Function</span> autoDuanZao()<br>    SetSimMode <span class="hljs-number">0</span><br>    <span class="hljs-keyword">While</span> <span class="hljs-literal">True</span><br>        //拖拽第一格装备到锻造炉<br>        MoveTo Array(<span class="hljs-number">0</span>) + <span class="hljs-number">488</span>, Array(<span class="hljs-number">1</span>) + <span class="hljs-number">288</span><br>        LeftDownS <span class="hljs-number">1</span><br>        Delay <span class="hljs-number">200</span><br>        MoveTo Array(<span class="hljs-number">0</span>) + <span class="hljs-number">331</span>, Array(<span class="hljs-number">1</span>) + <span class="hljs-number">295</span><br>        Delay <span class="hljs-number">200</span><br>        LeftUpS <span class="hljs-number">1</span><br>        //确定<br>        MoveTo Array(<span class="hljs-number">0</span>) + <span class="hljs-number">336</span>, Array(<span class="hljs-number">1</span>) + <span class="hljs-number">375</span><br>        Delay <span class="hljs-number">200</span><br>        LeftClick <span class="hljs-number">1</span><br>        //延迟<br>        Delay <span class="hljs-number">6500</span><br>        //确定<br>        KeyPress <span class="hljs-string">&quot;Enter&quot;</span>, <span class="hljs-number">1</span><br>        Delay <span class="hljs-number">200</span><br>    Wend<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//主程序<br><span class="hljs-keyword">If</span> Var0 = <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span><br>    <span class="hljs-keyword">Call</span> zengfu()<br><span class="hljs-keyword">ElseIf</span> Var0 = <span class="hljs-number">2</span> <span class="hljs-keyword">Then</span><br>    <span class="hljs-keyword">Call</span> wawaji()<br><span class="hljs-keyword">ElseIf</span> Var0 = <span class="hljs-number">3</span> <span class="hljs-keyword">Then</span><br>    <span class="hljs-keyword">Call</span> wawajiandzengfu()<br><span class="hljs-keyword">ElseIf</span> Var0 = <span class="hljs-number">4</span> <span class="hljs-keyword">Then</span><br>    <span class="hljs-keyword">Call</span> autoLeftClick()<br><span class="hljs-keyword">ElseIf</span>  Var0 = <span class="hljs-number">5</span> <span class="hljs-keyword">Then</span><br>    <span class="hljs-keyword">Call</span> autoDuanZao()<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br></code></pre></div></td></tr></table></figure>

<h2 id="五：大漠插件后台"><a href="#五：大漠插件后台" class="headerlink" title="五：大漠插件后台"></a>五：大漠插件后台</h2><p>先下载大漠插件(免费版即可)，将<code>dm.dll</code>和<code>RegDll.dll</code>两个文件添加到附件。</p>
<figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs vb">//解压大漠插件， 释放附件<br>PutAttachment <span class="hljs-string">&quot;C:\test_game\&quot;</span>,<span class="hljs-string">&quot;dm.dll&quot;</span><br><br>//插件注册开始<br><span class="hljs-keyword">Call</span> Plugin.RegDll.Reg(<span class="hljs-string">&quot;C:\test_game\dm.dll&quot;</span>)<br><br>//声明大漠对象<br><span class="hljs-keyword">Set</span> dm = createobject(<span class="hljs-string">&quot;dm.dmsoft&quot;</span>)<br><br>//判断插件是否成功<br>ver = dm.Ver()<br><span class="hljs-keyword">If</span> len(ver) = <span class="hljs-number">0</span> <span class="hljs-keyword">Then</span><br>//如果返回值<span class="hljs-string">&quot;ver&quot;</span>的长度为<span class="hljs-number">0</span>，则插件注册失败<br>    MessageBox <span class="hljs-string">&quot;插件注册失败,检查系统是否禁用了vbs脚本权限&quot;</span><br>    //结束脚本<br>    EndScript<br><span class="hljs-keyword">Else</span><br>    //否则,注册成功<br>    TracePrint <span class="hljs-string">&quot;插件注册成功&quot;</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><br>//这里设置插件基本目录<br>dm.SetPath(<span class="hljs-string">&quot;G:\code\C#\dmAll\dm&quot;</span>)<br><br>//声明句柄变量<br><span class="hljs-keyword">Dim</span> Hwnd, sRect<br><br>//获取句柄<br>Hwnd = dm.FindWindow(<span class="hljs-string">&quot;SDL_app&quot;</span>, <span class="hljs-string">&quot;Jin Shu QunXia&quot;</span>)<br>TracePrint Hwnd<br><br>//声明后台模式<br>dm_ret = dm.BindWindow(Hwnd, <span class="hljs-string">&quot;normal&quot;</span>, <span class="hljs-string">&quot;normal&quot;</span>, <span class="hljs-string">&quot;windows&quot;</span>, <span class="hljs-number">0</span>)<br><br><br><span class="hljs-keyword">Function</span> XiuLianDian()<br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">3600</span><br><br>    dm.KeyPress <span class="hljs-number">67</span><br>    //KeyPress <span class="hljs-string">&quot;C&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">39</span><br>    //KeyPressS <span class="hljs-number">39</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">1600</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> JiWuGong()<br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    dm.KeyPress <span class="hljs-number">65</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">5</span>*<span class="hljs-number">1000</span><br>    dm.KeyPress <span class="hljs-number">17</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">17</span><br>    Delay <span class="hljs-number">50</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">For</span> i=<span class="hljs-number">1</span> <span class="hljs-keyword">To</span> <span class="hljs-number">125</span><br>    <span class="hljs-keyword">Call</span> XiuLianDian()<br>    //<span class="hljs-keyword">Call</span> JiWuGong()<br><span class="hljs-keyword">Next</span><br><br>//释放句柄<br>dm_ret = dm.UnBindWindow()<br><br>//脚本停止运行<br>EndScript<br></code></pre></div></td></tr></table></figure>

<h2 id="六：-图片识别"><a href="#六：-图片识别" class="headerlink" title="六： 图片识别"></a>六： 图片识别</h2><p>先用大漠综合工具把图片处理下，图片四个角的像素点染成同一种颜色(默认为背景色)，稍微把背景色染成相同的颜色，处理一下。</p>
<figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs VB"><span class="hljs-type">long</span> FindPic(x1, y1, x2, y2, pic_name, delta_color,sim, dir,intX, intY)<br><br>//参数定义:<br><br>//x1 整形数:区域的左上X坐标<br>//y1 整形数:区域的左上Y坐标<br>//x2 整形数:区域的右下X坐标<br>//y2 整形数:区域的右下Y坐标<br>//pic_name 字符串:图片名,可以是多个图片,比如<span class="hljs-string">&quot;test.bmp|test2.bmp|test3.bmp&quot;</span><br>//delta_color 字符串:颜色色偏比如<span class="hljs-string">&quot;203040&quot;</span> 表示RGB的色偏分别是<span class="hljs-number">20</span> <span class="hljs-number">30</span> <span class="hljs-number">40</span> (这里是<span class="hljs-number">16</span>进制表示)<br>//sim 双精度浮点数:相似度,取值范围<span class="hljs-number">0.1</span>-<span class="hljs-number">1.0</span><br>//dir 整形数:查找方向 <span class="hljs-number">0</span>: 从左到右,从上到下 <span class="hljs-number">1</span>: 从左到右,从下到上 <span class="hljs-number">2</span>: 从右到左,从上到下 <span class="hljs-number">3</span>: 从右到左, 从下到上<br>//intX 变参指针:返回图片左上角的X坐标<br>//intY 变参指针:返回图片左上角的Y坐标<br><br>//整形数:返回找到的图片的序号,从<span class="hljs-number">0</span>开始索引.如果没找到返回-<span class="hljs-number">1</span><br><br>//示例:<br>dm_ret = dm.FindPic(<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">2000</span>,<span class="hljs-number">2000</span>,<span class="hljs-string">&quot;1.bmp|2.bmp|3.bmp&quot;</span>,<span class="hljs-string">&quot;000000&quot;</span>,<span class="hljs-number">0.9</span>,<span class="hljs-number">0</span>,intX,intY)<br><span class="hljs-keyword">If</span> intX &gt;= <span class="hljs-number">0</span> <span class="hljs-built_in">and</span> intY &gt;= <span class="hljs-number">0</span> <span class="hljs-keyword">Then</span><br>    MessageBox <span class="hljs-string">&quot;找到&quot;</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br></code></pre></div></td></tr></table></figure>

<p>简单源码示例：</p>
<figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs VB"><span class="hljs-keyword">Dim</span> 索引, 次数, 索引<span class="hljs-number">2</span>, 第n列<br>索引 = Array(<span class="hljs-number">5</span>,<span class="hljs-number">7</span>,<span class="hljs-number">10</span>,<span class="hljs-number">12</span>,<span class="hljs-number">15</span>)  //设置下拉框选项<br>次数 = 索引(Form1.ComboBox1.ListIndex)//得到下拉框内的数值<br><br>索引<span class="hljs-number">2</span> = Array(<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>)  //设置下拉框选项<br>第n列 = 索引<span class="hljs-number">2</span>(Form1.ComboBox2.ListIndex)     //得到下拉框内的数值<br><br><span class="hljs-keyword">Event</span> Form1.Load   //界面初始值设置   <br>    Form1.ComboBox1.List=<span class="hljs-string">&quot;5|7|10|12|15&quot;</span>  <br>    Form1.ComboBox1.ListIndex = <span class="hljs-number">0</span><br>    Form1.ComboBox2.List=<span class="hljs-string">&quot;1|2|3|4|5|6|7&quot;</span>  <br>    Form1.ComboBox2.ListIndex = <span class="hljs-number">1</span>   <br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Event</span>  <br><br><br>//释放“附件”中自己添加的文件到C:\test_game目录中，释放Regdll.dll到plugin目录中<br>//PutAttachment <span class="hljs-string">&quot;C:\test_game&quot;</span>, <span class="hljs-string">&quot;*.*&quot;</span><br>//PutAttachment <span class="hljs-string">&quot;.\plugin&quot;</span>,<span class="hljs-string">&quot;RegDll.dll&quot;</span><br><br>//调用regdll.dll,注册大漠插件<br>//<span class="hljs-keyword">Call</span> Plugin.RegDll.Reg(<span class="hljs-string">&quot;C:\test_game\dm.dll&quot;</span>)<br><br>//创建一个大漠对象<br><span class="hljs-keyword">Set</span> dm = createobject(<span class="hljs-string">&quot;dm.dmsoft&quot;</span>)<br><br>//判断插件是否成功<br>ver = dm.Ver()<br><span class="hljs-keyword">If</span> len(ver) = <span class="hljs-number">0</span> <span class="hljs-keyword">Then</span> <br>//如果返回值<span class="hljs-string">&quot;ver&quot;</span>的长度为<span class="hljs-number">0</span>，则插件注册失败<br>    MessageBox <span class="hljs-string">&quot;插件注册失败,检查系统是否禁用了vbs脚本权限&quot;</span><br>    //结束脚本<br>    EndScript<br><span class="hljs-keyword">Else</span> <br>    //否则,注册成功<br>    TracePrint <span class="hljs-string">&quot;插件注册成功,当前使用的版本是:&quot;</span>&amp;ver<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><br>//这里设置插件基本目录为注册的目录<br><span class="hljs-keyword">Call</span> dm.SetPath(dm.GetBasePath())<br><br>//声明句柄变量<br><span class="hljs-keyword">Dim</span> Hwnd, sRect<br><br>//获取句柄<br>Hwnd = dm.FindWindow(<span class="hljs-string">&quot;SDL_app&quot;</span>, <span class="hljs-string">&quot;Jin Shu QunXia&quot;</span>)<br>TracePrint Hwnd<br><br>//声明后台模式<br>dm_ret = dm.BindWindow(Hwnd, <span class="hljs-string">&quot;normal&quot;</span>, <span class="hljs-string">&quot;normal&quot;</span>, <span class="hljs-string">&quot;windows&quot;</span>, <span class="hljs-number">0</span>)<br><br><br><span class="hljs-keyword">Function</span> XiuLianDian()<br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">3600</span><br><br>    dm.KeyPress <span class="hljs-number">67</span><br>    //KeyPress <span class="hljs-string">&quot;C&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">39</span><br>    //KeyPressS <span class="hljs-number">39</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">500</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">1600</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> QunXiu()<br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">100</span><br>    dm.KeyPress <span class="hljs-number">38</span><br>    Delay <span class="hljs-number">100</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">38</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    //进入战斗等待时间<br>    Delay <span class="hljs-number">3</span>*<span class="hljs-number">1000</span><br><br>    dm.KeyPress <span class="hljs-number">67</span><br>    //KeyPress <span class="hljs-string">&quot;C&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">39</span><br>    //KeyPressS <span class="hljs-number">39</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">1500</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">1600</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> JiWuGong()<br>    //KeyPress <span class="hljs-string">&quot;Space&quot;</span>, <span class="hljs-number">1</span><br>    dm.KeyPress <span class="hljs-number">65</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">5</span>*<span class="hljs-number">1000</span><br>    dm.KeyPress <span class="hljs-number">17</span><br>    Delay <span class="hljs-number">50</span><br>    dm.KeyPress <span class="hljs-number">17</span><br>    Delay <span class="hljs-number">50</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> WaBaoZang()<br>    dm.KeyPress <span class="hljs-number">17</span><br>    Delay <span class="hljs-number">200</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">400</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">400</span><br>    dm.KeyPress <span class="hljs-number">40</span><br>    Delay <span class="hljs-number">400</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">400</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">400</span><br>    dm.KeyPress <span class="hljs-number">40</span><br>    Delay <span class="hljs-number">400</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">400</span><br>    dm.KeyPress <span class="hljs-number">32</span><br>    Delay <span class="hljs-number">400</span><br>    <span class="hljs-keyword">For</span> 第n列-<span class="hljs-number">1</span><br>        dm.KeyPress <span class="hljs-number">39</span><br>        Delay <span class="hljs-number">100</span><br>    <span class="hljs-keyword">Next</span><br>    <span class="hljs-keyword">For</span> 次数-<span class="hljs-number">1</span><br>        dm.KeyPress <span class="hljs-number">32</span><br>        Delay <span class="hljs-number">400</span><br>        dm.KeyPress <span class="hljs-number">40</span><br>        Delay <span class="hljs-number">400</span><br>    <span class="hljs-keyword">Next</span><br>    //获取宝藏个数，若为<span class="hljs-number">0</span>则读档，若不为<span class="hljs-number">0</span>，则存档<br>    dm_ret = dm.FindPic(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1920</span>, <span class="hljs-number">1080</span>, <span class="hljs-string">&quot;Attachment:\0.bmp&quot;</span>, <span class="hljs-string">&quot;000000&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">0</span>, intX, intY)<br>    <span class="hljs-keyword">If</span> intX &gt;= <span class="hljs-number">0</span> <span class="hljs-built_in">and</span> intY &gt;= <span class="hljs-number">0</span> <span class="hljs-keyword">Then</span> <br>        TracePrint <span class="hljs-string">&quot;没找到&quot;</span><br>        dm.KeyPress <span class="hljs-number">32</span><br>        Delay <span class="hljs-number">400</span><br>        <span class="hljs-keyword">For</span> i=<span class="hljs-number">1</span> <span class="hljs-keyword">To</span> <span class="hljs-number">20</span><br>            dm.Keypress <span class="hljs-number">17</span><br>            Delay <span class="hljs-number">100</span><br>        <span class="hljs-keyword">Next</span><br>        //读档<br>        dm.KeyPress <span class="hljs-number">76</span><br>        Delay <span class="hljs-number">400</span><br>        dm.KeyPress <span class="hljs-number">32</span><br>        Delay <span class="hljs-number">1000</span><br>    <span class="hljs-keyword">Else</span> <br>        TracePrint <span class="hljs-string">&quot;找到&quot;</span><br>        dm.KeyPress <span class="hljs-number">32</span><br>        Delay <span class="hljs-number">400</span><br>        <span class="hljs-keyword">For</span> i=<span class="hljs-number">1</span> <span class="hljs-keyword">To</span> <span class="hljs-number">20</span><br>            dm.Keypress <span class="hljs-number">17</span><br>            Delay <span class="hljs-number">100</span><br>        <span class="hljs-keyword">Next</span><br>        //存档<br>        dm.KeyPress <span class="hljs-number">83</span><br>        Delay <span class="hljs-number">400</span><br>        dm.KeyPress <span class="hljs-number">32</span><br>        Delay <span class="hljs-number">1000</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">For</span> i=<span class="hljs-number">1</span> <span class="hljs-keyword">To</span> <span class="hljs-number">125</span><br>    //<span class="hljs-keyword">Call</span> XiuLianDian()<br>    //<span class="hljs-keyword">Call</span> JiWuGong()<br>    //<span class="hljs-keyword">Call</span> QunXiu()<br>    <span class="hljs-keyword">Call</span> WaBaoZang()<br><span class="hljs-keyword">Next</span><br><br>//释放句柄<br>dm_ret = dm.UnBindWindow()<br><br>//脚本停止运行<br>EndScript<br></code></pre></div></td></tr></table></figure>

<h2 id="七、PC、安卓通用封装"><a href="#七、PC、安卓通用封装" class="headerlink" title="七、PC、安卓通用封装"></a>七、PC、安卓通用封装</h2><h3 id="1、PC通用封装"><a href="#1、PC通用封装" class="headerlink" title="1、PC通用封装"></a>1、PC通用封装</h3><figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs vb">//请在下面写上您的子程序或函数<br>//写完保存后，在任一命令库上点击右键并选择“刷新”即可<br><br><span class="hljs-keyword">Function</span> 判断时间是否介于(s1,s2) <span class="hljs-comment">&#x27;时间格式为小数</span><br>    <span class="hljs-keyword">If</span> hour(Now())+ minute(Now()) / <span class="hljs-number">60</span> &gt;= s1 <span class="hljs-built_in">and</span> hour(Now())+ minute(Now()) / <span class="hljs-number">60</span> &lt;= s2 <span class="hljs-keyword">Then</span> <br>        判断时间是否介于 = <span class="hljs-literal">True</span><br>    <span class="hljs-keyword">Else</span> <br>        判断时间是否介于 = <span class="hljs-literal">False</span> <br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    Delay <span class="hljs-number">500</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span>  当前时间()<br>    当前时间 = time() * <span class="hljs-number">100000</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//<span class="hljs-keyword">Call</span> 点击(<span class="hljs-number">100</span>,<span class="hljs-number">100</span>,<span class="hljs-number">2</span>)<br><span class="hljs-keyword">Function</span> 点击(x, y, 次数)<br>    次数 = 次数 <span class="hljs-built_in">or</span> <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">50</span><br>    MoveTo x, y<br>    LeftClick 次数<br>    Delay <span class="hljs-number">150</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//<span class="hljs-keyword">Call</span> 滑动(<span class="hljs-number">643</span>,<span class="hljs-number">561</span>,<span class="hljs-number">642</span>,<span class="hljs-number">347</span>,<span class="hljs-number">500</span>)<br><span class="hljs-keyword">Function</span> 滑动(x1, y1, x2, y2, 滑动间隔)<br>    Delay <span class="hljs-number">100</span><br>    MoveTo x1, y1<br>    Delay <span class="hljs-number">50</span><br>    LeftDown <span class="hljs-number">1</span><br>    Delay 滑动间隔 + <span class="hljs-number">200</span><br>    MoveTo x2, y2<br>    Delay <span class="hljs-number">50</span><br>    LeftUp <span class="hljs-number">1</span><br>    Delay <span class="hljs-number">100</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//<span class="hljs-keyword">Call</span> 找色(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">614</span>, <span class="hljs-number">1037</span>, <span class="hljs-string">&quot;00dcff&quot;</span>, <span class="hljs-number">1</span>)<br><span class="hljs-keyword">Function</span> 找色(x1, y1, x2, y2,颜色,是否点击)<br>    找色 = <span class="hljs-literal">False</span><br>    FindColorEx x1, y1, x2, y2, 颜色, <span class="hljs-number">1</span>, <span class="hljs-number">0.8</span>, X, Y<br>    <span class="hljs-keyword">If</span> X&gt;<span class="hljs-number">0</span> <span class="hljs-built_in">and</span> Y&gt;<span class="hljs-number">0</span>  <span class="hljs-keyword">Then</span> <br>        <span class="hljs-comment">&#x27;TracePrint &quot;找到&quot;</span><br>        <span class="hljs-keyword">If</span> 是否点击 = <span class="hljs-literal">True</span> <span class="hljs-built_in">or</span> 是否点击 = <span class="hljs-number">1</span> <span class="hljs-built_in">or</span> 是否点击 = <span class="hljs-string">&quot;是&quot;</span> <span class="hljs-keyword">Then</span> <br>            <span class="hljs-keyword">Call</span> 点击(X, Y, <span class="hljs-number">1</span>)<br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        找色 = <span class="hljs-literal">True</span><br>    <span class="hljs-keyword">Else</span> <br>        <span class="hljs-comment">&#x27;TracePrint &quot;没找到&quot;</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br>//<span class="hljs-keyword">Call</span> 找色(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">614</span>, <span class="hljs-number">1037</span>, <span class="hljs-string">&quot;00dcff&quot;</span>, <span class="hljs-number">1</span>, <span class="hljs-number">3</span>)<br><span class="hljs-keyword">Function</span> 等待找色(x1, y1, x2, y2, 颜色, 是否点击, 等待时间_秒)<br>    等待找色 = <span class="hljs-literal">False</span><br>    开始时间 = Plugin.Sys.GetTime()<br>    <br>    <span class="hljs-keyword">Do</span> <br>        FindColorEx x1, y1, x2, y2, 颜色, <span class="hljs-number">1</span>, <span class="hljs-number">0.8</span>, X, Y<br>        <span class="hljs-keyword">If</span> X&gt;<span class="hljs-number">0</span> <span class="hljs-built_in">and</span> Y&gt;<span class="hljs-number">0</span>  <span class="hljs-keyword">Then</span> <br>            <span class="hljs-comment">&#x27;TracePrint &quot;找到&quot;</span><br>            <span class="hljs-keyword">If</span> 是否点击 = <span class="hljs-literal">True</span> <span class="hljs-built_in">or</span> 是否点击 = <span class="hljs-number">1</span> <span class="hljs-built_in">or</span> 是否点击 = <span class="hljs-string">&quot;是&quot;</span> <span class="hljs-keyword">Then</span> <br>                <span class="hljs-keyword">Call</span> 点击(X, Y, <span class="hljs-number">1</span>)<br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>            等待找色 = <span class="hljs-literal">True</span><br>            <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">Function</span><br>        <span class="hljs-keyword">Else</span> <br>            <span class="hljs-comment">&#x27;TracePrint &quot;没找到&quot;</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    <span class="hljs-keyword">Loop</span> <span class="hljs-keyword">While</span> 等待时间_秒 * <span class="hljs-number">1000</span> &gt; Plugin.Sys.GetTime() - 开始时间<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> 找图点击(x1, y1, x2, y2, 图片, 是否点击, X偏移, Y偏移)  <span class="hljs-comment">&#x27;支持多图，用|分割</span><br>    图片组 = split(图片, <span class="hljs-string">&quot;|&quot;</span>)<br>    找图点击 = <span class="hljs-literal">False</span><br>    <br>    <span class="hljs-keyword">For</span> i = <span class="hljs-number">0</span> <span class="hljs-keyword">To</span> UBound(图片组)<br>        FindPic x1, y1, x2, y2, 图片组(i) , <span class="hljs-number">0.9</span>, intX,intY<br>        <span class="hljs-keyword">If</span> intX&gt;<span class="hljs-number">0</span> <span class="hljs-built_in">and</span> intY&gt;<span class="hljs-number">0</span> <span class="hljs-keyword">Then</span>  <br>            <span class="hljs-comment">&#x27;TracePrint &quot;找到&quot;</span><br>            <span class="hljs-keyword">If</span> 是否点击 = <span class="hljs-literal">True</span> <span class="hljs-built_in">or</span> 是否点击 = <span class="hljs-number">1</span> <span class="hljs-built_in">or</span> 是否点击 = <span class="hljs-string">&quot;是&quot;</span> <span class="hljs-keyword">Then</span> <br>                <span class="hljs-keyword">Call</span> 点击(intX + X偏移, intY + Y偏移, <span class="hljs-number">1</span>)<br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>            找图点击 = <span class="hljs-literal">True</span><br>            <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">Function</span> <br>        <span class="hljs-keyword">Else</span> <br>            <span class="hljs-comment">&#x27;TracePrint &quot;没找到&quot;</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    <span class="hljs-keyword">Next</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> 等待找图点击(x1, y1, x2, y2, 图片, 是否点击, 等待时间_秒, X偏移, Y偏移) <span class="hljs-comment">&#x27;支持多图，用|分割</span><br>    图片组 = split(图片, <span class="hljs-string">&quot;|&quot;</span>)<br>    等待找图点击 = <span class="hljs-literal">False</span><br>    开始时间 = Plugin.Sys.GetTime()<br>    <br>    <span class="hljs-keyword">Do</span> <br>        <span class="hljs-keyword">For</span> i = <span class="hljs-number">0</span> <span class="hljs-keyword">To</span> UBound(图片组)<br>            FindPic x1, y1, x2, y2, 图片组(i) , <span class="hljs-number">0.9</span>, intX,intY<br>            <span class="hljs-keyword">If</span> intX&gt;<span class="hljs-number">0</span> <span class="hljs-built_in">and</span> intY&gt;<span class="hljs-number">0</span> <span class="hljs-keyword">Then</span>  <br>                <span class="hljs-comment">&#x27;TracePrint &quot;找到&quot;</span><br>                <span class="hljs-keyword">If</span> 是否点击 = <span class="hljs-literal">True</span> <span class="hljs-built_in">or</span> 是否点击 = <span class="hljs-number">1</span> <span class="hljs-built_in">or</span> 是否点击 = <span class="hljs-string">&quot;是&quot;</span> <span class="hljs-keyword">Then</span> <br>                    <span class="hljs-keyword">Call</span> 点击(intX + X偏移, intY + Y偏移, <span class="hljs-number">1</span>)<br>                <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>                等待找图点击 = <span class="hljs-literal">True</span><br>                <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">Function</span> <br>            <span class="hljs-keyword">Else</span> <br>                <span class="hljs-comment">&#x27;TracePrint &quot;没找到&quot;</span><br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        <span class="hljs-keyword">Next</span><br>        Delay <span class="hljs-number">100</span><br>    <span class="hljs-keyword">Loop</span> <span class="hljs-keyword">While</span> 等待时间_秒 * <span class="hljs-number">1000</span> &gt; Plugin.Sys.GetTime() - 开始时间<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br></code></pre></div></td></tr></table></figure>

<h3 id="2、手机通用封装-未更改"><a href="#2、手机通用封装-未更改" class="headerlink" title="2、手机通用封装(未更改)"></a>2、手机通用封装(未更改)</h3><figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs vb"><span class="hljs-comment">&#x27;随机(1,10)</span><br><span class="hljs-keyword">Function</span> 随机(最小值,最大值)<br>    随机 = Int((最大值 - 最小值 + <span class="hljs-number">1</span>) * Rnd() + 最小值)<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><span class="hljs-comment">&#x27;延迟(1000)</span><br><span class="hljs-keyword">Function</span> 延迟(时间)<br>    Delay 时间 + 随机(<span class="hljs-number">100</span>, <span class="hljs-number">200</span>)<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><span class="hljs-comment">&#x27;点击延迟(281,596,1000)</span><br><span class="hljs-keyword">Function</span> 点击延迟(x, y, z)<br>    Tap x + 随机(-<span class="hljs-number">5</span>, <span class="hljs-number">5</span>), y + 随机(-<span class="hljs-number">5</span>, <span class="hljs-number">5</span>)<br>    延迟 (z)<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><span class="hljs-comment">&#x27;找色(0,0,0,0,&quot;563AF6-202020&quot;,1)</span><br><span class="hljs-keyword">Function</span> 找色(x1,y1,x2,y2,颜色,点击)<br>    <span class="hljs-keyword">Dim</span> X,Y<br>    找色 = <span class="hljs-literal">False</span><br>    FindColor x1,y1,x2,y2,颜色,<span class="hljs-number">0</span>,<span class="hljs-number">0.9</span>,X,Y<br>    <span class="hljs-keyword">If</span> X &gt; -<span class="hljs-number">1</span> <span class="hljs-built_in">And</span> Y &gt; -<span class="hljs-number">1</span> <span class="hljs-keyword">Then</span><br>        TracePrint X,Y<br>        <span class="hljs-keyword">If</span> 点击 = <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span> <br>            点击延迟 x, y, <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        找色 = <span class="hljs-literal">true</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><span class="hljs-comment">&#x27;多点找色(0,0,0,0,&quot;F7AC40-202020&quot;,&quot;-279|-19|1707BC-202020&quot;,1)</span><br><span class="hljs-keyword">Function</span> 找色多点(x1,y1,x2,y2,颜色<span class="hljs-number">1</span>,颜色<span class="hljs-number">2</span>,点击)<br>    <span class="hljs-keyword">Dim</span> X,Y<br>    找色多点 = <span class="hljs-literal">False</span><br>    FindMultiColor x1,y1,x2,y2,颜色<span class="hljs-number">1</span>,颜色<span class="hljs-number">2</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0.9</span>,X,Y<br>    <span class="hljs-keyword">If</span> X &gt; -<span class="hljs-number">1</span> <span class="hljs-built_in">And</span> Y &gt; -<span class="hljs-number">1</span> <span class="hljs-keyword">Then</span><br>        TracePrint X,Y<br>        <span class="hljs-keyword">If</span> 点击 = <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span> <br>            点击延迟 x, y, <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        找色多点 = <span class="hljs-literal">true</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><span class="hljs-comment">&#x27;比色(&quot;422|587|F7AC40-202020,143|568|1707BC-202020&quot;)</span><br><span class="hljs-keyword">Function</span> 比色(颜色)<br>    比色 =<span class="hljs-literal">False</span><br>    <span class="hljs-keyword">If</span> CmpColorEx(颜色,<span class="hljs-number">0.9</span>) = <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span><br>        比色 = <span class="hljs-literal">True</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><span class="hljs-comment">&#x27;找图(0,0,0,0,&quot;文件浏览器&quot;,1)</span><br><span class="hljs-keyword">Function</span> 找图(x1,y1,x2,y2,图片,点击)<br>    <span class="hljs-keyword">Dim</span> X,Y<br>    找图 = <span class="hljs-literal">False</span><br>    FindPic x1,y1,x2,y2,<span class="hljs-string">&quot;Attachment:&quot;</span>&amp;图片&amp;<span class="hljs-string">&quot;.png&quot;</span>,<span class="hljs-string">&quot;101010&quot;</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0.9</span>,X,Y<br>    <span class="hljs-keyword">If</span> X &gt; -<span class="hljs-number">1</span> <span class="hljs-built_in">And</span> Y &gt; -<span class="hljs-number">1</span> <span class="hljs-keyword">Then</span><br>        TracePrint X,Y<br>        <span class="hljs-keyword">If</span> 点击 = <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span> <br>        	点击延迟 x, y, <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        找图 = <span class="hljs-literal">True</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><span class="hljs-comment">&#x27;找图多图(0,0,0,0,&quot;Attachment:翻牌.png|Attachment:浏览器.png|Attachment:怒火.png&quot;,1)</span><br><span class="hljs-keyword">Function</span> 找图多图(x1,y1,x2,y2,图片,点击)<br>    <span class="hljs-keyword">Dim</span> X,Y<br>    找图多图 = <span class="hljs-literal">False</span><br>    FindPic x1,y1,x2,y2,图片,<span class="hljs-string">&quot;101010&quot;</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0.9</span>,X,Y<br>    <span class="hljs-keyword">If</span> X &gt; -<span class="hljs-number">1</span> <span class="hljs-built_in">And</span> Y &gt; -<span class="hljs-number">1</span> <span class="hljs-keyword">Then</span><br>        TracePrint X,Y<br>        <span class="hljs-keyword">If</span> 点击 = <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span> <br>        	点击延迟 x, y, <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        找图多图 = <span class="hljs-literal">True</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><span class="hljs-comment">&#x27;滑动(641, 728, 87, 565, 2000)</span><br><span class="hljs-keyword">Function</span> 滑动(x1, y1, x2, y2,滑动时间)<br>	Swipe x1 + 随机(-<span class="hljs-number">5</span>, <span class="hljs-number">5</span>), y1 + 随机(-<span class="hljs-number">5</span>, <span class="hljs-number">5</span>), x2 + 随机(-<span class="hljs-number">5</span>, <span class="hljs-number">5</span>), y2 + 随机(-<span class="hljs-number">5</span>, <span class="hljs-number">5</span>), 滑动时间<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br></code></pre></div></td></tr></table></figure>

<h2 id="八、实战小项目"><a href="#八、实战小项目" class="headerlink" title="八、实战小项目"></a>八、实战小项目</h2><h3 id="1、PC传奇挂机脚本"><a href="#1、PC传奇挂机脚本" class="headerlink" title="1、PC传奇挂机脚本"></a>1、PC传奇挂机脚本</h3><figure class="highlight vb"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br><span class="line">521</span><br><span class="line">522</span><br><span class="line">523</span><br><span class="line">524</span><br><span class="line">525</span><br><span class="line">526</span><br><span class="line">527</span><br><span class="line">528</span><br><span class="line">529</span><br><span class="line">530</span><br><span class="line">531</span><br><span class="line">532</span><br><span class="line">533</span><br><span class="line">534</span><br><span class="line">535</span><br><span class="line">536</span><br><span class="line">537</span><br><span class="line">538</span><br><span class="line">539</span><br><span class="line">540</span><br><span class="line">541</span><br><span class="line">542</span><br><span class="line">543</span><br><span class="line">544</span><br><span class="line">545</span><br><span class="line">546</span><br><span class="line">547</span><br><span class="line">548</span><br><span class="line">549</span><br><span class="line">550</span><br><span class="line">551</span><br><span class="line">552</span><br><span class="line">553</span><br><span class="line">554</span><br><span class="line">555</span><br><span class="line">556</span><br><span class="line">557</span><br><span class="line">558</span><br><span class="line">559</span><br><span class="line">560</span><br><span class="line">561</span><br><span class="line">562</span><br><span class="line">563</span><br><span class="line">564</span><br><span class="line">565</span><br><span class="line">566</span><br><span class="line">567</span><br><span class="line">568</span><br><span class="line">569</span><br><span class="line">570</span><br><span class="line">571</span><br><span class="line">572</span><br><span class="line">573</span><br><span class="line">574</span><br><span class="line">575</span><br><span class="line">576</span><br><span class="line">577</span><br><span class="line">578</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs vb"><span class="hljs-keyword">Sub</span> 获取句柄()<br>    hwnd = dm.FindWindowEx(<span class="hljs-number">0</span>, <span class="hljs-string">&quot;Game_client&quot;</span>, <span class="hljs-string">&quot;血饮龙纹-双线59服&quot;</span>)<br>    dm.MoveWindow hwnd, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>//移动窗口到左上角<br>    hwnd = dm.FindWindowEx(hwnd, <span class="hljs-string">&quot;&quot;</span>, <span class="hljs-string">&quot;&quot;</span>)<br>    hwnd = dm.FindWindowEx(hwnd, <span class="hljs-string">&quot;&quot;</span>, <span class="hljs-string">&quot;&quot;</span>)<br>    hwnd = dm.FindWindowEx(hwnd, <span class="hljs-string">&quot;&quot;</span>, <span class="hljs-string">&quot;&quot;</span>)<br>    TracePrint <span class="hljs-string">&quot;句柄： &quot;</span> &amp; hwnd<br>    dm.SetPath <span class="hljs-string">&quot;d:\pic&quot;</span><br>    //dm_ret = dm.BindWindowEx(hwnd,<span class="hljs-string">&quot;dx2&quot;</span>,<span class="hljs-string">&quot;dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.clip.lock.api|dx.mouse.input.lock.api|dx.mouse.state.api|dx.mouse.api|dx.mouse.cursor&quot;</span>,<span class="hljs-string">&quot;dx.keypad.input.lock.api|dx.keypad.state.api|dx.keypad.api|dx.keypad.raw.input&quot;</span>,<span class="hljs-string">&quot;dx.public.active.api|dx.public.active.message&quot;</span>,<span class="hljs-number">0</span>)<br>    dm_ret = dm.BindWindowEx(hwnd, <span class="hljs-string">&quot;gdi&quot;</span>, <span class="hljs-string">&quot;dx2&quot;</span>, <span class="hljs-string">&quot;windows&quot;</span>, <span class="hljs-string">&quot;&quot;</span>, <span class="hljs-number">0</span>)<br>    //dm_ret = dm.BindWindowEx(hwnd,<span class="hljs-string">&quot;dx2&quot;</span>,<span class="hljs-string">&quot;dx.mouse.state.api|dx.mouse.api|dx.mouse.cursor&quot;</span>,<span class="hljs-string">&quot;dx.keypad.state.api|dx.keypad.api&quot;</span>,<span class="hljs-string">&quot;dx.public.active.api|dx.public.active.message&quot;</span>,<span class="hljs-number">0</span>)<br>    Delay <span class="hljs-number">1500</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><br><span class="hljs-keyword">Sub</span> Tap(x,y)<br>    dm.MoveTo x,y<br>    Delay  <span class="hljs-number">50</span><br>    dm.LeftClick<br>    Delay  <span class="hljs-number">150</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><br><span class="hljs-keyword">Sub</span> TapR(x,y)<br>    dm.MoveTo x,y<br>    Delay  <span class="hljs-number">50</span><br>    dm.RightClick<br>    Delay  <span class="hljs-number">150</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><br><span class="hljs-keyword">Function</span> 多点比色(array)<br>    <span class="hljs-keyword">Dim</span> intX, intY<br>    多点比色 = <span class="hljs-literal">False</span><br>    多点比色 = dm.FindMultiColor(<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">1464</span>,<span class="hljs-number">854</span>,array(<span class="hljs-number">0</span>),array(<span class="hljs-number">1</span>),<span class="hljs-number">0.9</span>,<span class="hljs-number">0</span>,intX,intY)<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> 等待多点比色(array, time)<br>    <span class="hljs-keyword">Dim</span> intX, intY<br>    等待多点比色 = <span class="hljs-literal">False</span><br>    <span class="hljs-keyword">Do</span><br>        <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1464</span>,<span class="hljs-number">854</span>, array(<span class="hljs-number">0</span>), array(<span class="hljs-number">1</span>), <span class="hljs-number">0.9</span>, <span class="hljs-number">0</span>, intX, intY) <span class="hljs-keyword">Then</span> <br>            等待多点比色 = <span class="hljs-literal">True</span> <br>            <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">Do</span><br>        <span class="hljs-keyword">Else</span> <br>            Delay time * <span class="hljs-number">100</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    <span class="hljs-keyword">Loop</span> <br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> 自动攻击()<br>    <span class="hljs-keyword">Dim</span> 检测未在攻击<br>    检测未在攻击 = <span class="hljs-number">0</span><br>    <span class="hljs-keyword">For</span> <span class="hljs-number">10</span><br>        <span class="hljs-keyword">If</span> 多点比色(比色_攻击) <span class="hljs-keyword">Then</span> <br>            //TracePrint <span class="hljs-string">&quot;自动攻击中&quot;</span><br>            自动攻击 = <span class="hljs-literal">true</span><br>            <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">For</span><br>        <span class="hljs-keyword">Else</span> <br>            检测未在攻击 = 检测未在攻击 + <span class="hljs-number">1</span><br>            <span class="hljs-keyword">If</span> 检测未在攻击 = <span class="hljs-number">10</span> <span class="hljs-keyword">Then</span> <br>                TracePrint <span class="hljs-string">&quot;检测未在攻击，准备开启自动攻击&quot;</span>&amp;检测未在攻击<br>                自动攻击 = <span class="hljs-literal">False</span> <br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        Delay <span class="hljs-number">100</span>	<br>    <span class="hljs-keyword">Next</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> 开启自动攻击()<br>    //<span class="hljs-keyword">If</span> 多点比色(比色_危险区) <span class="hljs-keyword">Then</span> <br>    <span class="hljs-keyword">If</span> 自动攻击() <span class="hljs-keyword">Then</span> <br>    <span class="hljs-keyword">Else</span> <br>        TracePrint <span class="hljs-string">&quot;开启自动攻击&quot;</span><br>        Tap <span class="hljs-number">1111</span>,<span class="hljs-number">641</span>  //dm.KeyPressChar <span class="hljs-string">&quot;z&quot;</span><br>        Delay  <span class="hljs-number">1000</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    //<span class="hljs-keyword">Else</span> <br>    //TracePrint <span class="hljs-string">&quot;安全区，无需自动攻击&quot;</span><br>    //<span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span> <br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Dim</span> 无怪随机间隔,无怪随机开始时间<br>无怪随机间隔 = <span class="hljs-number">50</span><br>无怪随机开始时间 = 当前时间()<br><span class="hljs-keyword">Function</span> 无怪随机()<br>    <span class="hljs-keyword">If</span> 多点比色(比色_危险区) <span class="hljs-keyword">Then</span> <br>        <span class="hljs-keyword">If</span> 多点比色(比色_有怪) <span class="hljs-keyword">Then</span> <br>            TracePrint <span class="hljs-string">&quot;随机-&gt;有怪&quot;</span><br>            无怪随机开始时间 = 当前时间()<br>        <span class="hljs-keyword">Else</span> <br>            TracePrint <span class="hljs-string">&quot;随机-&gt;持续无怪时间&quot;</span> &amp; int(当前时间() - 无怪随机开始时间) &amp; <span class="hljs-string">&quot;秒&quot;</span><br>            <span class="hljs-keyword">If</span> 当前时间() - 无怪随机开始时间 &gt; 无怪随机间隔 * <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span> <br>                点击随机 <br>                无怪随机开始时间 = 当前时间()<br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span> <br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Dim</span> 无怪回城间隔,无怪回城开始时间<br>无怪回城间隔 = <span class="hljs-number">3</span>*<span class="hljs-number">60</span><br>无怪回城开始时间 = 当前时间()<br><span class="hljs-keyword">Function</span> 无怪回城()<br>    <span class="hljs-keyword">If</span> 多点比色(比色_危险区) <span class="hljs-keyword">Then</span> <br>        <span class="hljs-keyword">If</span> 多点比色(比色_有怪) <span class="hljs-keyword">Then</span> <br>            TracePrint <span class="hljs-string">&quot;回城-&gt;有怪&quot;</span><br>            无怪回城开始时间 = 当前时间()<br>        <span class="hljs-keyword">Else</span> <br>            TracePrint <span class="hljs-string">&quot;回城-&gt;持续无怪时间&quot;</span> &amp; int(当前时间() - 无怪回城开始时间) &amp; <span class="hljs-string">&quot;秒&quot;</span><br>            <span class="hljs-keyword">If</span> 当前时间() - 无怪回城开始时间 &gt; 无怪回城间隔 * <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span> <br>                点击回城 <br>                无怪回城开始时间 = 当前时间()<br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Sub</span> 点击回城()<br>    <span class="hljs-keyword">Dim</span> intX,intY<br>    dm_ret = dm.FindMultiColor(<span class="hljs-number">588</span>, <span class="hljs-number">640</span>, <span class="hljs-number">878</span>, <span class="hljs-number">695</span>, 比色_回城(<span class="hljs-number">0</span>), 比色_回城(<span class="hljs-number">1</span>), <span class="hljs-number">0.9</span>, <span class="hljs-number">0</span>, intX, intY)<br>    <span class="hljs-keyword">If</span> intX &gt;= <span class="hljs-number">0</span> <span class="hljs-built_in">and</span> intY &gt;= <span class="hljs-number">0</span> <span class="hljs-keyword">Then</span> <br>        //TapR intX, intY<br>        dm.keypresschar <span class="hljs-string">&quot;q&quot;</span><br>        TracePrint <span class="hljs-string">&quot;点击回城&quot;</span><br>        Delay <span class="hljs-number">1000</span><br>        Tap <span class="hljs-number">750</span>, <span class="hljs-number">450</span><br>        Delay <span class="hljs-number">2000</span><br>    <span class="hljs-keyword">Else</span> <br>        TracePrint <span class="hljs-string">&quot;未找到回城&quot;</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><br><span class="hljs-keyword">Sub</span> 点击随机()<br>    <span class="hljs-keyword">Dim</span> intX,intY<br>    dm_ret = dm.FindMultiColor(<span class="hljs-number">588</span>, <span class="hljs-number">640</span>, <span class="hljs-number">878</span>, <span class="hljs-number">695</span>, 比色_随机(<span class="hljs-number">0</span>), 比色_随机(<span class="hljs-number">1</span>), <span class="hljs-number">0.8</span>, <span class="hljs-number">0</span>, intX, intY)<br>    <span class="hljs-keyword">If</span> intX &gt;= <span class="hljs-number">0</span>  <span class="hljs-built_in">and</span> intY &gt;= <span class="hljs-number">0</span>  <span class="hljs-keyword">Then</span> <br>        //TapR intX, intY<br>        dm.keypresschar <span class="hljs-string">&quot;w&quot;</span><br>        TracePrint <span class="hljs-string">&quot;点击随机&quot;</span><br>        Delay <span class="hljs-number">2000</span><br>    <span class="hljs-keyword">Else</span> <br>        TracePrint <span class="hljs-string">&quot;未找到随机&quot;</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><br><span class="hljs-keyword">Function</span>  自动购买随机()<br>    Tap <span class="hljs-number">1157</span>,<span class="hljs-number">778</span><br>    TracePrint <span class="hljs-string">&quot;点击商城&quot;</span><br>    Delay <span class="hljs-number">500</span><br>    <span class="hljs-keyword">If</span> 等待多点比色(Array(<span class="hljs-string">&quot;E7AE1C&quot;</span>,<span class="hljs-string">&quot;0|-5|710602,3|0|510503,-4|1|000000&quot;</span>), <span class="hljs-number">3</span>) <span class="hljs-keyword">Then</span> <br>        Tap <span class="hljs-number">841</span>, <span class="hljs-number">428</span><br>        Delay <span class="hljs-number">500</span><br>        <span class="hljs-keyword">For</span> <span class="hljs-number">13</span><br>            dm.WheelDown <br>            Delay <span class="hljs-number">50</span><br>        <span class="hljs-keyword">Next</span><br>        Tap <span class="hljs-number">508</span>,<span class="hljs-number">579</span><br>        TracePrint <span class="hljs-string">&quot;点击随机&quot;</span><br>        Delay <span class="hljs-number">500</span><br>        <span class="hljs-keyword">If</span> 等待多点比色(Array(<span class="hljs-string">&quot;BBAE96&quot;</span>,<span class="hljs-string">&quot;-1|0|111111,2|3|4D4840,4|2|D2C3A8,4|0|F8E6C6&quot;</span>), <span class="hljs-number">3</span>) <span class="hljs-keyword">Then</span> <br>            Tap <span class="hljs-number">965</span>,<span class="hljs-number">568</span><br>            TracePrint <span class="hljs-string">&quot;点击确定&quot;</span><br>            Delay <span class="hljs-number">500</span><br>            Tap <span class="hljs-number">1118</span>,<span class="hljs-number">221</span><br>            TracePrint <span class="hljs-string">&quot;关闭商城&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span> <br><br><span class="hljs-keyword">Function</span>  自动购买回城()<br>    Tap <span class="hljs-number">1157</span>,<span class="hljs-number">778</span><br>    TracePrint <span class="hljs-string">&quot;点击商城&quot;</span><br>    Delay <span class="hljs-number">500</span><br>    <span class="hljs-keyword">If</span> 等待多点比色(Array(<span class="hljs-string">&quot;E7AE1C&quot;</span>,<span class="hljs-string">&quot;0|-5|710602,3|0|510503,-4|1|000000&quot;</span>), <span class="hljs-number">3</span>) <span class="hljs-keyword">Then</span> <br>        Tap <span class="hljs-number">841</span>, <span class="hljs-number">428</span><br>        Delay <span class="hljs-number">500</span><br>        <span class="hljs-keyword">For</span> <span class="hljs-number">13</span><br>            dm.WheelDown <br>            Delay <span class="hljs-number">50</span><br>        <span class="hljs-keyword">Next</span><br>        Tap <span class="hljs-number">992</span>,<span class="hljs-number">426</span><br>        TracePrint <span class="hljs-string">&quot;点击回城&quot;</span><br>        Delay <span class="hljs-number">500</span><br>        <span class="hljs-keyword">If</span> 等待多点比色(Array(<span class="hljs-string">&quot;BBAE96&quot;</span>,<span class="hljs-string">&quot;-1|0|111111,2|3|4D4840,4|2|D2C3A8,4|0|F8E6C6&quot;</span>), <span class="hljs-number">3</span>) <span class="hljs-keyword">Then</span> <br>            Tap <span class="hljs-number">965</span>,<span class="hljs-number">568</span><br>            TracePrint <span class="hljs-string">&quot;点击确定&quot;</span><br>            Delay <span class="hljs-number">500</span><br>            Tap <span class="hljs-number">1118</span>,<span class="hljs-number">221</span><br>            TracePrint <span class="hljs-string">&quot;关闭商城&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span> <br><br><span class="hljs-keyword">Dim</span> 副本数组, 顺序副本下标, 选择条件<br>副本数组 = Array()<br>顺序副本下标 = <span class="hljs-number">0</span> <br><span class="hljs-keyword">Function</span> 自动副本()<br>    <span class="hljs-keyword">If</span> 多点比色(比色_安全区) <span class="hljs-keyword">Then</span> <br>        <span class="hljs-keyword">If</span> 顺序副本下标 = UBound(副本数组) <span class="hljs-keyword">Then</span> <br>            选择条件 = 副本数组(顺序副本下标)<br>            顺序副本下标 = <span class="hljs-number">0</span><br>        <span class="hljs-keyword">Else</span> <br>            选择条件 = 副本数组(顺序副本下标)<br>            顺序副本下标 = 顺序副本下标 + <span class="hljs-number">1</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        TracePrint 选择条件<br>        <span class="hljs-keyword">If</span> 选择条件 = null <span class="hljs-keyword">Then</span> <br>            TracePrint <span class="hljs-string">&quot;未选择副本&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>	<br>        UserVar 选择条件=<span class="hljs-number">0</span> <span class="hljs-string">&quot;输入（0~9）数字&quot;</span><br>        <span class="hljs-keyword">Select</span> <span class="hljs-keyword">Case</span> 选择条件<br>        <span class="hljs-keyword">Case</span> 神之领域六层<br>            Msgbox <span class="hljs-string">&quot;你输入的数字为：0&quot;</span> <br>        <span class="hljs-keyword">Case</span> 封号神殿六层<br>            Msgbox <span class="hljs-string">&quot;你输入的数字为：1&quot;</span> <br>        <span class="hljs-keyword">Case</span> <span class="hljs-keyword">Else</span><br>            Msgbox <span class="hljs-string">&quot;你输入的数字不正确，请输入（0~9）数字！&quot;</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">Select</span><br>        <span class="hljs-comment">&#x27;检查副本前准备动作</span><br>        <span class="hljs-comment">&#x27;重置无怪时间</span><br>        无怪回城开始时间 = 当前时间()<br>        无怪随机开始时间 = 当前时间()<br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span> 	<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><br>Randomize    <span class="hljs-comment">&#x27;初始化随机数生成器。</span><br><span class="hljs-keyword">Function</span> 自动下本()<br>    <span class="hljs-comment">&#x27;检测到在盟重或在安全区</span><br>    <span class="hljs-keyword">If</span> 多点比色(比色_安全区) <span class="hljs-built_in">And</span> dm.FindMultiColor(<span class="hljs-number">1349</span>, <span class="hljs-number">30</span>, <span class="hljs-number">1465</span>, <span class="hljs-number">58</span>, <span class="hljs-string">&quot;D9D9D9&quot;</span>, <span class="hljs-string">&quot;-2|-1|5A5A59,-4|2|636363,-7|4|636363,-8|4|D9D9D9,-8|2|9A9A9A&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, intX, intY) <span class="hljs-keyword">Then</span> <br>        MyValue = Int((<span class="hljs-number">2</span> * Rnd) + <span class="hljs-number">1</span>)<span class="hljs-comment">&#x27; 产生 1 到 3 之间的随机数。</span><br>        //MyValue = <span class="hljs-number">3</span><br>        <span class="hljs-keyword">Select</span> <span class="hljs-keyword">Case</span> MyValue   <br>        <span class="hljs-keyword">Case</span> <span class="hljs-number">1</span><br>            Tap <span class="hljs-number">1261</span>, <span class="hljs-number">69</span><br>            TracePrint <span class="hljs-string">&quot;点击首领挑战&quot;</span><br>            Delay <span class="hljs-number">1500</span><br>            Tap <span class="hljs-number">445</span>, <span class="hljs-number">670</span><br>            TracePrint <span class="hljs-string">&quot;点击鸿蒙&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>            TracePrint <span class="hljs-string">&quot;随机到封号神殿&quot;</span><br>            <span class="hljs-comment">&#x27;去封号神殿六层</span><br>            Tap <span class="hljs-number">808</span>,<span class="hljs-number">447</span><br>            TracePrint <span class="hljs-string">&quot;点击封号神殿六层&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>            Tap <span class="hljs-number">187</span>, <span class="hljs-number">175</span><br>            TracePrint <span class="hljs-string">&quot;点击神殿卷轴&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>            Tap <span class="hljs-number">795</span>, <span class="hljs-number">453</span><br>            TracePrint <span class="hljs-string">&quot;购买神殿卷轴&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>            Tap <span class="hljs-number">246</span>,<span class="hljs-number">438</span><br>            TracePrint <span class="hljs-string">&quot;点击点击封号神殿&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">Case</span> <span class="hljs-number">2</span><br>            TracePrint <span class="hljs-string">&quot;随机到冰雪森林&quot;</span><br>            Delay <span class="hljs-number">500</span><br>            <span class="hljs-comment">&#x27;检测迷失之地是否隐藏</span><br>            <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">911</span>,<span class="hljs-number">32</span>,<span class="hljs-number">1346</span>,<span class="hljs-number">194</span>,<span class="hljs-string">&quot;C39F57&quot;</span>,<span class="hljs-string">&quot;0|5|1E0906,5|5|F8EA68,-2|6|885B22,-2|8|1E0906,2|11|3B2F1B&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>                TracePrint <span class="hljs-string">&quot;准备点击迷失之地&quot;</span><br>                Tap x, y<br>                Delay <span class="hljs-number">1000</span><br>            <span class="hljs-keyword">Else</span> <br>                TracePrint <span class="hljs-string">&quot;未检测到迷失之地&quot;</span><br>                Tap <span class="hljs-number">1324</span>, <span class="hljs-number">73</span><br>                Delay <span class="hljs-number">1000</span><br>                <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">911</span>,<span class="hljs-number">32</span>,<span class="hljs-number">1346</span>,<span class="hljs-number">194</span>,<span class="hljs-string">&quot;C39F57&quot;</span>,<span class="hljs-string">&quot;0|5|1E0906,5|5|F8EA68,-2|6|885B22,-2|8|1E0906,2|11|3B2F1B&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>                    TracePrint <span class="hljs-string">&quot;准备点击迷失之地&quot;</span><br>                    Tap x, y<br>                    Delay <span class="hljs-number">1000</span><br>                <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span> <br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span> <br>            <span class="hljs-comment">&#x27;点击冰霜大陆</span><br>            <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">289</span>, <span class="hljs-number">150</span>, <span class="hljs-number">1137</span>, <span class="hljs-number">735</span>, <span class="hljs-string">&quot;6C6861&quot;</span>,<span class="hljs-string">&quot;0|1|111111,0|2|6C6861,0|3|111111,0|4|615E58,-15|5|3E3C39,-15|6|2F2D2B&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>                TracePrint <span class="hljs-string">&quot;点击冰霜大陆&quot;</span><br>                Tap x, y<br>                Delay <span class="hljs-number">1000</span><br>                <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">289</span>, <span class="hljs-number">150</span>, <span class="hljs-number">1137</span>, <span class="hljs-number">735</span>, <span class="hljs-string">&quot;28EF01&quot;</span>,<span class="hljs-string">&quot;0|-1|111111,3|-2|25CE03,1|2|28EF01,1|3|209E07,6|2|25CE03&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>                    TracePrint <span class="hljs-string">&quot;点击立即前往&quot;</span><br>                    Tap x, y<br>                    Delay <span class="hljs-number">1000</span><br>                <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>                <span class="hljs-keyword">Do</span><br>                    <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1920</span>, <span class="hljs-number">1080</span>,<span class="hljs-string">&quot;087F02&quot;</span>,<span class="hljs-string">&quot;1|0|0AD300,9|0|09B000,7|3|0CFE00,10|3|0BDF00,2|3|0CFE00,5|5|08A400&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, intX, intY) <span class="hljs-keyword">Then</span> <br>                        Tap intX,intY<br>                        TracePrint <span class="hljs-string">&quot;点击冰雪森林跨服&quot;</span><br>                        Delay <span class="hljs-number">4000</span><br>                        <span class="hljs-keyword">If</span> 多点比色(array(<span class="hljs-string">&quot;FFE400&quot;</span>,<span class="hljs-string">&quot;0|1|685E0B,0|2|FFE400,2|2|FFE400,2|1|8A7D08,2|0|FFE400,1|7|111111&quot;</span>)) <span class="hljs-keyword">Then</span> <br>                            Tap <span class="hljs-number">87</span>,<span class="hljs-number">179</span><br>                            TracePrint <span class="hljs-string">&quot;点击冰雪森林&quot;</span><br>                            Delay <span class="hljs-number">1000</span><br>                            Tap <span class="hljs-number">755</span>,<span class="hljs-number">265</span><br>                            <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">Do</span><br>                        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>                    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>                <span class="hljs-keyword">Loop</span><br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span>	<br>        <span class="hljs-keyword">Case</span> <span class="hljs-keyword">Else</span><br>            Tap <span class="hljs-number">1261</span>, <span class="hljs-number">69</span><br>            TracePrint <span class="hljs-string">&quot;点击首领挑战&quot;</span><br>            Delay <span class="hljs-number">1500</span><br>            Tap <span class="hljs-number">445</span>, <span class="hljs-number">670</span><br>            TracePrint <span class="hljs-string">&quot;点击鸿蒙&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>            TracePrint <span class="hljs-string">&quot;随机到神铸遗迹&quot;</span><br>            <span class="hljs-comment">&#x27;去神铸遗迹</span><br>            Tap <span class="hljs-number">617</span>, <span class="hljs-number">447</span><br>            TracePrint <span class="hljs-string">&quot;点击神之领域六层&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>            Tap <span class="hljs-number">561</span>, <span class="hljs-number">53</span><br>            TracePrint <span class="hljs-string">&quot;关闭窗口&quot;</span><br>            Delay <span class="hljs-number">500</span><br>            <span class="hljs-keyword">Do</span><br>                <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1920</span>, <span class="hljs-number">1080</span>, <span class="hljs-string">&quot;0CFA00&quot;</span>, <span class="hljs-string">&quot;6|-4|0ADE00,1|-2|08B000,2|-2|08B000,6|-6|FDCD2E,6|2|044F00,7|2|011F00,2|4|020100&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, intX, intY) <span class="hljs-keyword">Then</span> <br>                    Tap intX,intY<br>                    TracePrint <span class="hljs-string">&quot;点击神铸遗迹&quot;</span><br>                    Delay <span class="hljs-number">3000</span><br>                    <span class="hljs-keyword">If</span> 多点比色(array(<span class="hljs-string">&quot;ECDBBD&quot;</span>, <span class="hljs-string">&quot;2|0|655F53,2|4|F8E6C6,-1|4|F8E6C6,-1|2|111111&quot;</span>)) <span class="hljs-keyword">Then</span> <br>                        Tap <span class="hljs-number">90</span>, <span class="hljs-number">288</span><br>                        TracePrint <span class="hljs-string">&quot;点击神铸遗迹一层&quot;</span><br>                        Delay <span class="hljs-number">1000</span><br>                        <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">Do</span><br>                    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>                <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>            <span class="hljs-keyword">Loop</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">Select</span>  <br><br>        无怪回城开始时间 = 当前时间()<br>        无怪随机开始时间 = 当前时间()<br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span> <br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> 自动协助()<br>    <span class="hljs-keyword">If</span> 判断时间是否介于(<span class="hljs-number">12</span>, <span class="hljs-number">12</span>) <span class="hljs-built_in">or</span> 判断时间是否介于(<span class="hljs-number">21</span>, <span class="hljs-number">21</span>) <span class="hljs-keyword">Then</span> <br>        <span class="hljs-keyword">If</span> 多点比色(比色_协助) <span class="hljs-keyword">Then</span> <br>            Tap <span class="hljs-number">1295</span>,<span class="hljs-number">335</span><br>            TracePrint <span class="hljs-string">&quot;前往协助&quot;</span><br>            Delay <span class="hljs-number">500</span><br>            开启自动攻击 <br>            Delay <span class="hljs-number">500</span><br>            <span class="hljs-comment">&#x27;检测是否在恶魔祭坛</span><br>            <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">1346</span>, <span class="hljs-number">32</span>, <span class="hljs-number">1466</span>, <span class="hljs-number">56</span>, <span class="hljs-string">&quot;838383&quot;</span>, <span class="hljs-string">&quot;1|0|ECECEC,1|3|838383,4|5|B6B6B6,5|5|9A9A9A,6|3|202021,10|2|838383,9|1|111111&quot;</span>, <span class="hljs-number">0.9</span>,<span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>                TracePrint <span class="hljs-string">&quot;检测到在恶魔祭坛&quot;</span><br>                Delay <span class="hljs-number">2000</span><br>                <span class="hljs-keyword">Do</span><br>                    <span class="hljs-keyword">If</span> 多点比色(比色_有怪) <span class="hljs-keyword">Then</span> <br>                        TracePrint <span class="hljs-string">&quot;恶魔祭坛-&gt;有怪&quot;</span><br>                        Delay <span class="hljs-number">2000</span><br>                    <span class="hljs-keyword">Else</span> <br>                        TracePrint <span class="hljs-string">&quot;恶魔祭坛-&gt;无怪，准备回城&quot;</span><br>                        Delay <span class="hljs-number">500</span><br>                        Tap <span class="hljs-number">300</span>, <span class="hljs-number">230</span><br>                        Delay <span class="hljs-number">500</span><br>                        Tap <span class="hljs-number">840</span>, <span class="hljs-number">510</span><br>                        Delay <span class="hljs-number">500</span><br>                        <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">Do</span> <br>                    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>                <span class="hljs-keyword">Loop</span> <br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        <span class="hljs-keyword">Else</span> <br>            TracePrint <span class="hljs-string">&quot;未检测到协助&quot;</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    <span class="hljs-keyword">Else</span> <br>        <span class="hljs-comment">&#x27;TracePrint &quot;当前不是协助时间&quot;</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><br><span class="hljs-keyword">Function</span> 自动攻城()<br>    <span class="hljs-comment">&#x27;检测到攻城感叹号和在石原，如果在开启自动攻击，如果不在去石原</span><br>    <span class="hljs-keyword">If</span> 多点比色(比色_攻城) <span class="hljs-keyword">Then</span> <br>        Tap <span class="hljs-number">539</span>, <span class="hljs-number">638</span><br>        TracePrint <span class="hljs-string">&quot;检测到攻城,点击感叹号&quot;</span><br>        Delay <span class="hljs-number">1000</span><br>        Tap <span class="hljs-number">629</span>, <span class="hljs-number">510</span><br>        TracePrint <span class="hljs-string">&quot;点击石原攻城&quot;</span><br>        Delay <span class="hljs-number">1000</span><br><br>        <span class="hljs-comment">&#x27;检测是否在石原,如果在</span><br>        <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">1346</span>, <span class="hljs-number">32</span>, <span class="hljs-number">1466</span>, <span class="hljs-number">56</span>, <span class="hljs-string">&quot;F1F1F1&quot;</span>, <span class="hljs-string">&quot;0|1|B6B6B6,1|1|111111,2|2|E6E6E6,4|1|B6B6B6,-2|2|232223&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>            <span class="hljs-keyword">If</span> 多点比色(比色_攻击) <span class="hljs-keyword">Then</span> <br>                TracePrint <span class="hljs-string">&quot;未开启自动攻击，准备开启自动攻击&quot;</span><br>                dm.keypresschar <span class="hljs-string">&quot;z&quot;</span><br>                Delay <span class="hljs-number">1000</span><br>            <span class="hljs-keyword">Else</span> <br>                TracePrint <span class="hljs-string">&quot;已开启自动攻击&quot;</span><br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>            <span class="hljs-keyword">Do</span><br>                <span class="hljs-keyword">If</span> 多点比色(比色_攻城) <span class="hljs-keyword">Then</span> <br>                    开启自动攻击 <br>                    TracePrint <span class="hljs-string">&quot;自动攻城中...&quot;</span><br>                    自动回收 <br>                    Delay <span class="hljs-number">1000</span>*<span class="hljs-number">60</span><br>                <span class="hljs-keyword">Else</span> <br>                	TracePrint <span class="hljs-string">&quot;攻城结束&quot;</span><br>                    <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">Do</span> <br>                <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>                <br>            <span class="hljs-keyword">Loop</span><br>        <span class="hljs-keyword">Else</span> <br>            TracePrint <span class="hljs-string">&quot;不在石原,准备回城&quot;</span><br>            dm.keypresschar <span class="hljs-string">&quot;q&quot;</span><br>            Delay <span class="hljs-number">1000</span> <br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        无怪回城开始时间 = 当前时间()<br>        无怪随机开始时间 = 当前时间()<br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span>	<br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><span class="hljs-keyword">Function</span> 异常处理()<br>    <span class="hljs-comment">&#x27;安全复活</span><br>    <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">2000</span>,<span class="hljs-number">2000</span>, 比色_复活(<span class="hljs-number">0</span>), 比色_复活(<span class="hljs-number">1</span>), <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>        TracePrint <span class="hljs-string">&quot;检测到死亡,点击安全复活&quot;</span><br>        Tap x, y<br>        Delay <span class="hljs-number">2000</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>	<br>    <span class="hljs-comment">&#x27;行会祭坛</span><br>    <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">513</span>,<span class="hljs-number">369</span>,<span class="hljs-number">960</span>,<span class="hljs-number">545</span>, <span class="hljs-string">&quot;D3D3D3&quot;</span>,<span class="hljs-string">&quot;2|1|CCCCCC,1|4|838383,0|4|D3D3D3,-1|4|4B4B4B,-1|7|CCCCCC,-2|7|ECECEC,4|7|111111,6|7|9A9A9A,8|7|636363,8|13|151413&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>        TracePrint <span class="hljs-string">&quot;检测到行会祭坛,点击进入&quot;</span><br>        Tap <span class="hljs-number">839</span>,<span class="hljs-number">510</span><br>        Delay <span class="hljs-number">2000</span><br>        开启自动攻击 <br>        Delay <span class="hljs-number">2000</span><br>        <span class="hljs-keyword">Do</span><br>            <span class="hljs-keyword">If</span> 多点比色(比色_有怪) <span class="hljs-keyword">Then</span> <br>                TracePrint <span class="hljs-string">&quot;行会祭坛中&quot;</span><br>                Delay <span class="hljs-number">2000</span><br>            <span class="hljs-keyword">Else</span> <br>            	Delay <span class="hljs-number">1000</span><br>                <span class="hljs-keyword">Exit</span> <span class="hljs-keyword">Do</span> <br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        <span class="hljs-keyword">Loop</span> <br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>	<br>    <span class="hljs-comment">&#x27;装备更新</span><br>    <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">1245</span>,<span class="hljs-number">502</span>,<span class="hljs-number">1321</span>,<span class="hljs-number">536</span>, <span class="hljs-string">&quot;ECDBBD&quot;</span>,<span class="hljs-string">&quot;0|-2|111111,-3|-2|5E5850,-2|0|111111,-1|0|9E9380,1|1|655F53,-1|9|BBAE96,-2|11|4D4840&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>        TracePrint <span class="hljs-string">&quot;检测到有装备更新&quot;</span><br>        Tap x,y<br>        Delay <span class="hljs-number">1500</span><br>        <span class="hljs-comment">&#x27;快速传承</span><br>        <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">511</span>,<span class="hljs-number">371</span>,<span class="hljs-number">960</span>,<span class="hljs-number">546</span>,<span class="hljs-string">&quot;E6E6E6&quot;</span>,<span class="hljs-string">&quot;-1|0|646463,-2|3|9A9A9A,2|3|B6B6B6,1|4|CCCCCC,5|2|838383&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>            TracePrint <span class="hljs-string">&quot;检测到装备可快速传承&quot;</span><br>            Tap <span class="hljs-number">840</span>, <span class="hljs-number">510</span><br>            Delay <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span> <br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>	<br>    <span class="hljs-comment">&#x27;冰霜大陆回盟重</span><br>    <span class="hljs-keyword">If</span> 多点比色(比色_冰霜大陆) <span class="hljs-keyword">Then</span> <br>        Tap <span class="hljs-number">1261</span>, <span class="hljs-number">70</span><br>        Delay <span class="hljs-number">1000</span><br>        Tap <span class="hljs-number">446</span>, <span class="hljs-number">435</span><br>        Delay <span class="hljs-number">1000</span><br>        Tap <span class="hljs-number">615</span>, <span class="hljs-number">449</span><br>        Delay <span class="hljs-number">1000</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    <br>    <span class="hljs-comment">&#x27;无攻城回城</span><br>    <span class="hljs-keyword">If</span> 多点比色(比色_攻城) <span class="hljs-keyword">Then</span> <br>    <span class="hljs-keyword">Else</span> <br>        <span class="hljs-comment">&#x27;如果在石原</span><br>        <span class="hljs-keyword">If</span> dm.FindMultiColor(<span class="hljs-number">1346</span>, <span class="hljs-number">32</span>, <span class="hljs-number">1466</span>, <span class="hljs-number">56</span>, <span class="hljs-string">&quot;F1F1F1&quot;</span>, <span class="hljs-string">&quot;0|1|B6B6B6,1|1|111111,2|2|E6E6E6,4|1|B6B6B6,-2|2|232223&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">1</span>, x, y) <span class="hljs-keyword">Then</span> <br>            TracePrint <span class="hljs-string">&quot;在石原未攻城,准备回城&quot;</span><br>            dm.keypresschar <span class="hljs-string">&quot;q&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br><br><span class="hljs-keyword">Dim</span> 自动回收间隔,自动回收开始时间,intX,intY<br>自动回收间隔 = <span class="hljs-number">60</span><br>自动回收开始时间 = 当前时间()<br><span class="hljs-keyword">Function</span> 自动回收()	<br>    TracePrint <span class="hljs-string">&quot;自动回收倒计时&quot;</span> &amp; - int((当前时间() - 自动回收开始时间 - 自动回收间隔))  &amp; <span class="hljs-string">&quot;秒&quot;</span><br>    <span class="hljs-keyword">If</span> 当前时间() - 自动回收开始时间 &gt; 自动回收间隔 * <span class="hljs-number">1</span> <span class="hljs-keyword">Then</span> <br>        Tap <span class="hljs-number">83</span>, <span class="hljs-number">295</span>//激活窗口<br>        Delay <span class="hljs-number">500</span><br>    <br>        dm.KeyPressChar <span class="hljs-string">&quot;esc&quot;</span><br>        TracePrint <span class="hljs-string">&quot;回到主界面&quot;</span><br>        Delay <span class="hljs-number">500</span><br>        <br>        <span class="hljs-keyword">If</span> 多点比色(array(<span class="hljs-string">&quot;F5DE44&quot;</span>, <span class="hljs-string">&quot;2|-1|1A191A,0|-5|263A5F&quot;</span>)) <span class="hljs-keyword">Then</span> <br>            Tap <span class="hljs-number">1116</span>,<span class="hljs-number">695</span><br>            TracePrint <span class="hljs-string">&quot;打开背包&quot;</span><br>            Delay <span class="hljs-number">1000</span><br>            <span class="hljs-keyword">If</span> 等待多点比色(array(<span class="hljs-string">&quot;FFE400&quot;</span>, <span class="hljs-string">&quot;0|3|0E5197,4|1|102D4B&quot;</span>),<span class="hljs-number">5</span>) <span class="hljs-keyword">Then</span> <br>                dm_ret = dm.FindPic(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1464</span>, <span class="hljs-number">854</span>, <span class="hljs-string">&quot;D:\pic\回收.bmp&quot;</span>, <span class="hljs-string">&quot;000000&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">0</span>, intX, intY)<br>                <span class="hljs-keyword">If</span> intX &gt;= <span class="hljs-number">0</span> <span class="hljs-built_in">and</span> intY &gt;= <span class="hljs-number">0</span> <span class="hljs-keyword">Then</span> <br>                    Tap intX,intY<br>                    //Tap <span class="hljs-number">645</span>,<span class="hljs-number">633</span>  //点击回收<br>                    Delay <span class="hljs-number">500</span><br>                    TracePrint <span class="hljs-string">&quot;点击回收&quot;</span><br>                    Tap <span class="hljs-number">935</span>,<span class="hljs-number">609</span>//点击快速回收<br>                    TracePrint <span class="hljs-string">&quot;回收成功&quot;</span><br>                    Delay <span class="hljs-number">500</span><br>                <span class="hljs-keyword">Else</span> <br>                    TracePrint <span class="hljs-string">&quot;回收失败&quot;</span><br>                <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>            <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span> <br>            Tap <span class="hljs-number">727</span>, <span class="hljs-number">231</span>//关闭背包<br>            TracePrint <span class="hljs-string">&quot;关闭背包&quot;</span><br>            Delay <span class="hljs-number">3000</span><br>        <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>        自动回收开始时间 = 当前时间()<br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span> <br><br><br><span class="hljs-comment">&#x27;通用传奇脚本需更改变量</span><br><span class="hljs-keyword">Dim</span> 比色_危险区, 比色_安全区,比色_有怪 ,比色_协助 ,比色_随机, 比色_回城<br>比色_危险区 = Array(<span class="hljs-string">&quot;FF0500&quot;</span>,<span class="hljs-string">&quot;-2|-3|6C0C0A,-1|3|4C0E0D,-1|-1|111111&quot;</span>)<br>比色_安全区 = Array(<span class="hljs-string">&quot;28EF01&quot;</span>,<span class="hljs-string">&quot;0|-2|23BC05,-1|2|25D703,1|2|312A22,1|1|111111&quot;</span>)<br>比色_有怪 = Array(<span class="hljs-string">&quot;F1F1F1&quot;</span>,<span class="hljs-string">&quot;0|1|111111,1|1|636363,7|4|E6E6E6,12|-10|FF0000&quot;</span>)<br>比色_协助 = Array(<span class="hljs-string">&quot;D8C103&quot;</span>,<span class="hljs-string">&quot;-1|1|111111,1|2|765F3C,-2|2|C0AD04,-3|-2|8A7D08&quot;</span>)<br>比色_随机 = Array(<span class="hljs-string">&quot;D9CE51&quot;</span>,<span class="hljs-string">&quot;3|0|8E5F0E,2|-5|C7C3B0,-3|2|2E1F08,-4|7|413D3A&quot;</span>)<br>比色_回城 = Array(<span class="hljs-string">&quot;A70ED9&quot;</span>, <span class="hljs-string">&quot;5|-1|9606CF,8|1|E30AF4,-2|5|A70ED9,5|5|513F57&quot;</span>)<br>比色_攻击 = Array(<span class="hljs-string">&quot;F47C0E&quot;</span>,<span class="hljs-string">&quot;4|-2|EA6A08,2|0|FFFFFF,-1|0|FDCB53,-1|1|F47C0E&quot;</span>)<br>比色_攻城 = Array(<span class="hljs-string">&quot;FCF7DA&quot;</span>, <span class="hljs-string">&quot;2|16|C09D4A,1|24|C09D4A,1|26|201C18,1|29|9B7B39,1|30|C97F26&quot;</span>)<br>比色_复活 = Array(<span class="hljs-string">&quot;B7AF9C&quot;</span>, <span class="hljs-string">&quot;0|3|F2E7CE,0|5|EDE2CA,3|4|5D4B27,0|8|F2E7CE,0|9|58462E,-4|6|111111,-4|5|68532A,17|4|725C3A,17|1|F2E7CE,17|0|9B9485,12|1|5C4727&quot;</span>)<br>比色_冰霜大陆 = Array(<span class="hljs-string">&quot;111111&quot;</span>,<span class="hljs-string">&quot;0|-1|C5C5C5,-1|-1|F1F1F1,-1|-2|111111,0|-2|636363,1|-2|D9D9D9,2|-2|636363,12|2|636363,12|3|CCCCCC&quot;</span>)<br><span class="hljs-comment">&#x27;主程序</span><br><br>大漠注册()<br>获取句柄 <br><br><span class="hljs-comment">&#x27;功能区</span><br><span class="hljs-keyword">Do</span><br>    异常处理<br>    自动回收 <br>    开启自动攻击<br>    Delay <span class="hljs-number">1000</span> * <span class="hljs-number">2</span><br>    无怪随机 <br>    无怪回城<br>    自动协助 <br>    自动攻城 <br>    自动下本<br><span class="hljs-keyword">Loop</span><br><br><span class="hljs-keyword">Sub</span> OnScriptExit()<br>    dm.UnBindWindow<br>    <span class="hljs-keyword">set</span> dm = <span class="hljs-literal">nothing</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><br><span class="hljs-keyword">Function</span>  当前时间()<br>    当前时间 = time() * <span class="hljs-number">100000</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br>                <br><span class="hljs-keyword">Sub</span> 大漠注册()<br>    //[把dm.dll和RegDll.dll放到附件]<br>    PutAttachment <span class="hljs-string">&quot;C:\test_game&quot;</span>, <span class="hljs-string">&quot;dm.dll&quot;</span><span class="hljs-comment">&#x27;是否大漠插件到到&quot;C:\test_game&quot;文件夹内</span><br>    PutAttachment <span class="hljs-string">&quot;.\Plugin&quot;</span> ,<span class="hljs-string">&quot;RegDll.dll&quot;</span><span class="hljs-comment">&#x27;释放RegDll插件到按键精灵安装目录下的Plugin[即插件]文件夹内</span><br>    <span class="hljs-keyword">Call</span> Plugin.RegDll.Reg(<span class="hljs-string">&quot;c:\test_game\dm.dll&quot;</span>) <span class="hljs-comment">&#x27;采用RegDll插件的Reg命令进行大漠插件注册</span><br>    <span class="hljs-keyword">Set</span> dm = createobject(<span class="hljs-string">&quot;dm.dmsoft&quot;</span>)<span class="hljs-comment">&#x27;创建大漠对象</span><br>    TracePrint dm.Ver()<span class="hljs-comment">&#x27;输出大漠版本号</span><br>//    dm_ret = dm.Reg(<span class="hljs-string">&quot;testhlee1e7a5cf173317f0618377c923b09bc&quot;</span>,<span class="hljs-string">&quot;wNLupvlKgcbjykac&quot;</span>) // abcdefg是您的注册码. 在大漠插件网站后台可以直接获取.<br>//    <span class="hljs-keyword">if</span> dm_ret &lt;&gt; <span class="hljs-number">1</span> <span class="hljs-keyword">then</span><br>//        messagebox <span class="hljs-string">&quot;注册失败,返回值是:&quot;</span>&amp; dm_ret<br>//		EndScript<br>//    <span class="hljs-keyword">Else</span> <br>//        TracePrint <span class="hljs-string">&quot;注册成功,返回值是:&quot;</span>&amp; dm_ret<br>//    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span>  <br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Sub</span><br><br><span class="hljs-keyword">Function</span> 判断时间是否介于(s1,s2)<br>    <span class="hljs-keyword">If</span> hour(Now()) &gt;= s1 <span class="hljs-built_in">and</span> hour(Now()) &lt;= s2 <span class="hljs-keyword">Then</span> <br>        判断时间是否介于 = <span class="hljs-literal">True</span><br>    <span class="hljs-keyword">Else</span> <br>        判断时间是否介于 = <span class="hljs-literal">False</span> <br>    <span class="hljs-keyword">End</span> <span class="hljs-keyword">If</span><br>    Delay <span class="hljs-number">500</span><br><span class="hljs-keyword">End</span> <span class="hljs-keyword">Function</span><br><br></code></pre></div></td></tr></table></figure>



<h2 id="参考视频"><a href="#参考视频" class="headerlink" title="参考视频"></a>参考视频</h2><p><a target="_blank" rel="noopener" href="https://space.bilibili.com/3196036/channel/detail?cid=100704">https://space.bilibili.com/3196036/channel/detail?cid=100704</a></p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">读书笔记</a>
                    
                      <a class="hover-with-bg" href="/categories/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/VB/">VB</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/%E6%8C%89%E9%94%AE%E7%B2%BE%E7%81%B5/">按键精灵</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2020/04/21/games/DNF/DNF%E6%90%AD%E5%BB%BA/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">DNF搭建说明</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2020/04/03/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/SQL/SQL%E8%AF%AD%E8%A8%80%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">
                        <span class="hidden-mobile">SQL语言学习笔记</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
              <!-- Comments -->
              <article class="comments" id="comments" lazyload>
                
                  
                
                
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js', function () {
        new Valine({
          el: "#valine",
          app_id: "YzLqNtMw1YEwwACli1FUsIUM-gzGzoHsz",
          app_key: "HLUt5izfTvTcbEbOrA59W92a",
          placeholder: "畅所欲言...",
          path: window.location.pathname,
          avatar: "robohash",
          meta: ["nick","mail","link"],
          pageSize: "10",
          lang: "zh-CN",
          highlight: true,
          recordIP: false,
          serverURLs: "",
        });
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


              </article>
            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->

  <div class="col-lg-7 mx-auto nopadding-x-md">
    <div class="container custom post-custom mx-auto">
      <img src="https://closer_laps.coding.net/p/picture/d/picture/git/raw/master/pay/pay.png" srcset="/img/loading.gif" lazyload class="rounded mx-auto d-block mt-3" style="width:355.4px; height:200px;">
    </div>
  </div>


    

    
      <a id="scroll-top-button" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  
  <div class="statistics">
    
    

    
      
        <!-- LeanCloud 统计PV -->
        <span id="leancloud-site-pv-container" style="display: none">
            总访问量 
            <span id="leancloud-site-pv"></span>
             次
          </span>
      
      
        <!-- LeanCloud 统计UV -->
        <span id="leancloud-site-uv-container" style="display: none">
            总访客数 
            <span id="leancloud-site-uv"></span>
             人
          </span>
      

    
  </div>


  
  <!-- 备案信息 -->
  <div class="beian">
    <span>
      <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
        苏ICP备20032307号
      </a>
    </span>
    
      
        <span>
          <a
            href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=32020602001023"
            rel="nofollow noopener"
            class="beian-police"
            target="_blank"
          >
            
              <span style="visibility: hidden; width: 0">|</span>
              <img src="/img/police_beian.png" srcset="/img/loading.gif" lazyload alt="police-icon"/>
            
            <span>苏公网安备 32020602001023号</span>
          </a>
        </span>
      
    
  </div>


  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  <script  src="https://cdn.jsdelivr.net/npm/tocbot@4.12.2/dist/tocbot.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4.3.0/anchor.min.js" ></script>



  <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js" ></script>




  <script defer src="/js/leancloud.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    (function () {
      var path = "/local-search.xml";
      $('#local-search-input').on('click', function() {
        searchFunc(path, 'local-search-input', 'local-search-result');
      });
      $('#modalSearch').on('shown.bs.modal', function() {
        $('#local-search-input').focus();
      });
    })()
  </script>





  

  
    <!-- MathJax -->
    <script>
      MathJax = {
        tex: {
          inlineMath: [['$', '$'], ['\\(', '\\)']]
        },
        options: {
          renderActions: {
            findScript: [10, doc => {
              document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
                const display = !!node.type.match(/; *mode=display/);
                const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
                const text = document.createTextNode('');
                node.parentNode.replaceChild(text, node);
                math.start = { node: text, delim: '', n: 0 };
                math.end = { node: text, delim: '', n: 0 };
                doc.math.push(math);
              });
            }, '', false],
            insertedScript: [200, () => {
              document.querySelectorAll('mjx-container').forEach(node => {
                let target = node.parentNode;
                if (target.nodeName.toLowerCase() === 'li') {
                  target.parentNode.classList.add('has-jax');
                }
              });
            }, '', false]
          }
        }
      };
    </script>

    <script async src="https://cdn.jsdelivr.net/npm/mathjax@3.1.2/es5/tex-svg.js" ></script>

  








  
    <!-- Baidu Analytics -->
    <script defer>
      var _hmt = _hmt || [];
      (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?608f2baddd361128381ad2bf9377bf89";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
  

  

  

  

  

  





<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
